Ask Your Question
0

How should I measure how well my CascadeClassifier is working?

asked 2017-10-14 06:05:19 -0600

maxisme gravatar image

I am currently trying to optimise my CascadeClassifier used to detect faces on the raspberry pi. There are two main factors - Speed and Quality.

SPEED
I want the camera to pick up a face as quickly as possible so as to react to the image and also I want to collect as many photos as possible of the face.

QUALITY
I need the camera to be able to pick up the face (obviously). I am finding this the most difficult to measure as I am only knowing how well it has done after running a stream loop from the camera which returns cropped images of the face - any tips on how to measure this would be great.

My configuration setup is this with the detectMultiScale function:

CLASSIFIER = 'haarcascade_frontalface_default.xml'
SCALE_FACTOR = 1.4
MIN_SIZE = (30, 30)
NEIGHBOURS = 4

and this gives me about two images per second.

I was wondering if I could multithread the detection to take advantage of all 4 cores so as to keep collecting images on 1 thread and on the other 3 run the classifications are there any issues with this?

Ideally I would like the photos of the face to be of a lot higher quality then the current (640, 480) And then cropped to the actual size of the face which could be 30,30 as I am then planning to run a recognition algorithm on the face itself afterwords.

Currently if I remove the classification the RPi takes 12 images per second at (640, 480) and 6 per second at (1080, 960) which seems pretty slow in itself.

Any advice on these tasks would be greatly appreciated. I am thinking that maybe an RPi is not the answer and I should invest in some better hardware.

edit retag flag offensive close merge delete

Comments

(i have never used raspberry pi) maybe we will try some tricks on this sample video. could you share the code you used.

sturkmen gravatar imagesturkmen ( 2017-10-14 07:52:31 -0600 )edit

"I was wondering if I could multithread the detection" -- don't.the CascadeClassifier is not thread-safe (keeping global state).

for quality: use the annotation tool, to generate ground truth positions, then read in your info.txt, check detection on the same images, and compare results with IOU (intersection over union)

berak gravatar imageberak ( 2017-10-15 01:06:34 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2017-10-24 14:59:24 -0600

maxisme gravatar image

http://vis-www.cs.umass.edu/fddb/ - This data set contains the annotations for 5171 faces in a set of 2845 images taken from the Faces in the Wild data set.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-10-14 06:05:19 -0600

Seen: 170 times

Last updated: Oct 24 '17