Open klarala opened 2 years ago
~ We can also try to make the program work with other image types (right now it only works with .jpg) ~ We can try to change the input images' resolution before processing them, so that the processing consumes less time.
I run a test with 78 files in 2 subdirectories, total of 608MB.
** Warnings There are some warnings:
$ python3 face.py -help /usr/lib/python3/dist-packages/secretstorage/dhcrypto.py:15: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead from cryptography.utils import int_from_bytes /usr/lib/python3/dist-packages/secretstorage/util.py:19: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead from cryptography.utils import int_from_bytes This program is designed to detect and classify faces from a file directory. Please enter the path to the folder you want to scan as the first argument, if you want to forget the previous analysed pictures please use the option reset Every faces detected will be displayed as a *, every file analysed as a : , every folder scaned as a O The program only accepts .jpg files for now (.jpeg doesn't work either) so be sure that all your picture have this extention. ie: python face.py /home/pierrec/Desktop/test_img_reco/Big_test/Photos/Christmas -reset
** Docs It's not documented where extracted faces are stored and how. The documentation has to comply with the requirements, see the project description.
** Unexpected termination
If the file is broken (e.g. an empty file) the program terminates:
$ python3 face.py /tmp/p
/usr/lib/python3/dist-packages/secretstorage/dhcrypto.py:15: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
from cryptography.utils import int_from_bytes
/usr/lib/python3/dist-packages/secretstorage/util.py:19: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead
from cryptography.utils import int_from_bytes
O
Traceback (most recent call last):
File "face.py", line 136, in
** Some undocumented errors $ python3 face.py /tmp/p /usr/lib/python3/dist-packages/secretstorage/dhcrypto.py:15: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead from cryptography.utils import int_from_bytes /usr/lib/python3/dist-packages/secretstorage/util.py:19: CryptographyDeprecationWarning: int_from_bytes is deprecated, use int.from_bytes instead from cryptography.utils import int_from_bytes O ERROR FACE DETECTED BUT NO ENCODING POSSIBLE /home/wojnicki/work/ss2/2021/SS2_Krak/Photos_copy/20210806-greece/0728-162551_00.png : : ERROR FACE DETECTED BUT NO ENCODING POSSIBLE /home/wojnicki/work/ss2/2021/SS2_Krak/Photos_copy/20210806-greece/0728-162553_20.png : : : : ERROR FACE DETECTED BUT NO ENCODING POSSIBLE /home/wojnicki/work/ss2/2021/SS2_Krak/Photos_copy/20210806-greece/0728-121436_60.png : ERROR FACE DETECTED BUT NO ENCODING POSSIBLE /home/wojnicki/work/ss2/2021/SS2_Krak/Photos_copy/20210806-greece/0728-133756_70.png : : : : : : ERROR FACE DETECTED BUT NO ENCODING POSSIBLE /home/wojnicki/work/ss2/2021/SS2_Krak/Photos_copy/20210806-greece/0728-133807_130.png ERROR FACE DETECTED BUT NO ENCODING POSSIBLE /home/wojnicki/work/ss2/2021/SS2_Krak/Photos_copy/20210806-greece/0728-133807_130.png ERROR FACE DETECTED BUT NO ENCODING POSSIBLE /home/wojnicki/work/ss2/2021/SS2_Krak/Photos_copy/20210806-greece/0728-133807_130.png : : : : ERROR FACE DETECTED BUT NO ENCODING POSSIBLE /home/wojnicki/work/ss2/2021/SS2_Krak/Photos_copy/20210806-greece/0728-133832_170.png : : : : : O : : : : : : : : ERROR FACE DETECTED BUT NO ENCODING POSSIBLE /home/wojnicki/work/ss2/2021/SS2_Krak/Photos_copy/20210828-lukecin/0827-114121_80.png : : : : ERROR FACE DETECTED BUT NO ENCODING POSSIBLE /home/wojnicki/work/ss2/2021/SS2_Krak/Photos_copy/20210828-lukecin/0827-125504_120.png : : : : : : : : : **: : : : ERROR FACE DETECTED BUT NO ENCODING POSSIBLE /home/wojnicki/work/ss2/2021/SS2_Krak/Photos_copy/20210828-lukecin/0827-134328_250.png : : : : : : : : : : : : : : ERROR FACE DETECTED BUT NO ENCODING POSSIBLE /home/wojnicki/work/ss2/2021/SS2_Krak/Photos_copy/20210828-lukecin/0818-123811_390.png ERROR FACE DETECTED BUT NO ENCODING POSSIBLE /home/wojnicki/work/ss2/2021/SS2_Krak/Photos_copy/20210828-lukecin/0818-123811_390.png ERROR FACE DETECTED BUT NO ENCODING POSSIBLE /home/wojnicki/work/ss2/2021/SS2_Krak/Photos_copy/20210828-lukecin/0818-123811_390.png : : : : **: : : : : : : : : : : : : O
** It's slow, but speed in not a factor.
** How good is identification of the same person?
** Why do you use png for the faces, esp. if the pictures have to be jpgs?
** What do I need Photos_copy directory for? Where is Faces directory? What's in it?
** Number of detected persons is way too low.
It might be the error messages I mentioned...
I'd suggest running some more tests and add the results to the docs.
** Warnings
** Docs It's not documented where extracted faces are stored and how. The documentation has to comply with the requirements, see the project description.
** Unexpected termination If the file is broken (e.g. an empty file) the program terminates:
Traceback (most recent call last): File "face.py", line 136, in image = face_recognition.load_image_file(os.path.join(subdir, file)) File "/home/wojnicki/.local/lib/python3.8/site-packages/face_recognition/api.py", line 86, in load_image_file im = PIL.Image.open(file) File "/usr/lib/python3/dist-packages/PIL/Image.py", line 2861, in open raise UnidentifiedImageError( PIL.UnidentifiedImageError: cannot identify image file '/tmp/p/20210806-greece/0730-191749a.jpg'
** Some undocumented errors
ERROR FACE DETECTED BUT NO ENCODING POSSIBLE /home/wojnicki/work/ss2/2021/SS2_Krak/Photos_copy/20210806-greece/0728-162551_00.png
** It's slow, but speed in not a factor.
** How good is identification of the same person?
** Why do you use png for the faces, esp. if the pictures have to be jpgs?
** What do I need Photos_copy directory for? Where is Faces directory? What's in it?
** Number of detected persons is way too low.
As discussed it is probably because of this big amount of encoding errors
Since our program for face recognition and classification is almost finished, we were wondering what our next steps should be to improve it. We can focus on multiple things, for example:
~ improving the performance of face classification by reanalyzing already classified faces ~ making it cross-platform ~ adding more options for the user - for example asking the user to specify the name of a person assigned to a specific directory or trace back from one face to the original image or trace back from one directory to all the original images containing the faces in the directory. There are many things that can be done.
Any other suggestions and ideas are welcome.