eduardolundgren / tracking.js

A modern approach for Computer Vision on the web
http://trackingjs.com
Other
9.43k stars 1.44k forks source link

Unable to detect small faces #295

Open RayLuxembourg opened 6 years ago

RayLuxembourg commented 6 years ago

Is it possible to detect faces with rect width and height of around 50px?

alexandermaisey commented 6 years ago

The camera I am testing with has a max resolution of 1900x1080 but I configured the HTML camera object's resolution to 1280x720, and my monitor is 1080 native. I find that it stops detecting faces below 39x39 px so it may be dependent on your monitor resolution or the resolution of the camera.

RayLuxembourg commented 6 years ago

@alexandermaisey could you share your settings?

alexandermaisey commented 6 years ago

getUserMedia({ audio: false, video: { facingMode: 'user', width: { ideal: 1280 }, height: { ideal: 720 }, frameRate: { ideal: 10, max: 10 } }})

alexandermaisey commented 6 years ago

And my setEdgesDensity is set to 0.2, everything else is default

RayLuxembourg commented 6 years ago

@alexandermaisey

    tracker.setInitialScale(4);
    tracker.setStepSize(2);

this what you mean default?

alexandermaisey commented 6 years ago

I haven't defined initialScale or stepSize, so they go to their default values; I believe stepSize is 1.5 and initialScale is 1.0 TBH I didn't understand what they did so I decided it was best to not mess with them.

RayLuxembourg commented 6 years ago

@alexandermaisey something is very wrong with the results.. image image

alexandermaisey commented 6 years ago

I tried setting tracker.setInitialScale(4) and tracker.setStepSize(2) and my application basically stopped detecting faces below or above 100px

When I modified to setEdgesDensity(0.1) setInitialScale(2) and setStepSize(1.2) it gets less weird and detects more size faces but still nothing under 39px

alexandermaisey commented 6 years ago

Like I said, I'm not sure what these do. Any clues?

RayLuxembourg commented 6 years ago

@alexandermaisey the documentation did poor job explaining this properties so I cant be sure. all i know is that i am able to detect down to 39px max but accuracy is weird.

shuodongLou commented 6 years ago

In order to reduce detecting time, I have to set a relatively small size for the images, basically I set the size nearly as the face(image) example given on the official website.

I used stepsize 1.7, which is used by the example, and keep everything else as default. But I got really low accuracy for face detection. The algorithm sometimes detect faces on images with no faces actually and sometimes it cannot detect any faces when there actually are. The estimate accuracy rate is like 50%, unacceptable.

I tried several combinations of image sizes/stepsize, apparently the image size affects accuracy greatly but I haven’t found a proper size/stepsize yer. Should I really mess with scalefactor and edgedensity? I don’t have a clue which value combinations should be given instead of the defaults.

nbpalomino commented 5 years ago

Where is explained the settings for:

Can someone explain a proper configuration ?

Thanks.