Face_recognition: I make dataset with about 200 photos. 40% of them dont have faces on this photos (nature pictures).

Created on 27 Mar 2019  路  1Comment  路  Source: ageitgey/face_recognition

I make dataset with about 200 photos. 40% of them dont have faces on this photos (nature pictures).
I enter this command
face_recognition --show-distance true ./pictures_of_people_i_know/ ./unknown_pictures/

And script give me lot of warnings from "/pictures_of_people_i_know/" folder like
WARNING: No faces found in ./pictures_of_people_i_know/*. Ignoring file.
WARNING: No faces found in ./pictures_of_people_i_know/
. Ignoring file.
WARNING: No faces found in ./pictures_of_people_i_know/
*. Ignoring file.

So I need function to delete this photos from my folder, not just warning, I NEED DELETE THEM
How can I get this ?

Most helpful comment

I also try to add some code in face_recognition_cli.py

if len(encodings) == 0:
click.echo("WARNING: No faces found in {}. Ignoring file.".format(file))
os.remove(file)

This seems works well

>All comments

I also try to add some code in face_recognition_cli.py

if len(encodings) == 0:
click.echo("WARNING: No faces found in {}. Ignoring file.".format(file))
os.remove(file)

This seems works well

Was this page helpful?
0 / 5 - 0 ratings