mauricesvay / php-facedetection

Detect face in images in pure PHP
GNU General Public License v2.0
755 stars 254 forks source link

report whether no face detected #36

Open Hamedhm opened 5 years ago

Hamedhm commented 5 years ago

Hi,

Thanks for the great script.

is there any way to return FALSE if no face is detected in the image?

SmuSmu commented 4 years ago
function HasFace($file)
    {
    $fd = new svay\FaceDetector();
    $fd->faceDetect($file);
    if (is_null($fd->getFace()))
        {
        return false;
        }
    else
        {
        return true;
        }
    }
Hamedhm commented 4 years ago

Thanks