Skip to content

Instantly share code, notes, and snippets.

@chexov
Created March 21, 2018 14:55
Show Gist options
  • Save chexov/d46e32e6274844d16bd34999d9032518 to your computer and use it in GitHub Desktop.
Save chexov/d46e32e6274844d16bd34999d9032518 to your computer and use it in GitHub Desktop.
Train HAAR like classifier. opencv 3.3.1 [opencv_createsamples]
export OPENCV_OPENCL_RUNTIME=""
find positives/ -type f | \
xargs -P 8 -n 1 -INAME opencv_createsamples -bgcolor 0 -bgthresh 0 -maxxangle 1.1 -maxyangle 1.1 -maxzangle 0.5 -maxidev 40 -w 80 -h 40 -img 'NAME' -bg ./negs/negatives.txt -vec samples/NAME.vec -num 1
wget 'https://raw.githubusercontent.com/wulfebw/mergevec/master/mergevec.py'
python mergevec.py -v ./samples/cuts/ -o samples.vec
OPENCV_OPENCL_RUNTIME=NVIDIA:GPU:1 opencv_traincascade -data classifier -vec samples.vec -bg negs/negatives.txt -numStages 20 -minHitRate 0.999 -maxFalseAlarmRate 0.5 -numPos 70000 -numNeg 78678 -w 80 -h 40 -mode ALL -precalcValBufSize 1024 -precalcIdxBufSize 1024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment