Skip to content

A toolbox to simplify training, testing, and running HAAR/LBP cascades for object detection

Notifications You must be signed in to change notification settings

zanazakaryaie/Cascade_Toolbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cascade_Toolbox

This is a toolbox to train, test, and run HAAR/LBP cascade easily.

Dependencies

  • C++17
  • Cmake: sudo apt install cmake
  • Zenity: sudo apt install zenity
  • OpenCV (versions 2 or 3): sudo apt install libopencv-dev
  • Simd (Optional)

How to build?

git clone https://github.com/zanazakaryaie/Cascade_Toolbox.git
cd Cascade_Toolbox
mkdir build && cd build
cmake ..
make

If you want to use Simd library to accelerate the detection, replace the cmake command by:

cmake -DBUILD_SIMD_INFERENCE=ON -DSIMD_LIBRARY_PATH=~/Simd ..

How to use?

Run the generated executables in the build folder following this order:

  1. collect_train_data
    Input: a training video (.mp4 or .avi)
    Instructions: draw and edit positive boxes with mouse (no need to draw negatives), press space to move to the next frames
    Output: Positive and Negative folders that contain sample images
    Demo Collect train data

  2. collect_test_data
    Input: a testing video (.mp4 or .avi)
    Instructions: draw and edit positive boxes with mouse, press space to move to the next frames
    Output: a folder that contain .txt annotations of each frame

  3. train
    Input: configs.yaml file, Positive and Negative folders
    Instructions: just wait for the training to finish
    Output: trained model in .xml format

  4. test
    Input: the testing video, the testing directory (output of 2), and the trained .xml model
    Output: prints the Precision and Recall of the trained detector

  5. hard_negative_mine
    Input: the training video, the trained .xml model
    Instructions: right-click in false positives, press space to move to the next frames.
    Output: new negative images added to the Negative folder

  6. train
    This is for including hard negatives and training a more accurate model.

  7. inference or inference_simd (if linked with Simd library)
    Input: a video (.mp4 or .avi) and the trained .xml model
    Output: the video played with detected objects and FPS
    Demo inference

Appendix

For more details read my posts on cascade algorithm and training a cascade model

Releases

No releases published

Packages

No packages published