fawkes icon indicating copy to clipboard operation
fawkes copied to clipboard

fawkes 1.0.2 exception thrown

Open xirkus opened this issue 3 years ago • 4 comments

When attempting to analyze an image with multiple faces, the following exception is thrown:

Traceback (most recent call last):
File "/var/lang/lib/python3.7/runpy.py", line 193, in _run_module_as_main\n "__main__", mod_spec)
File "/var/lang/lib/python3.7/runpy.py", line 85, in _run_code\n exec(code, run_globals)
File "/var/lang/lib/python3.7/site-packages/fawkes/__main__.py", line 10, in 
main()
File "/var/lang/lib/python3.7/site-packages/fawkes/protection.py", line 197, in main
separate_target=args.separate_target, debug=args.debug, no_align=args.no_align)
File "/var/lang/lib/python3.7/site-packages/fawkes/protection.py", line 129, in run_protection
reverse_process_cloaked(original_images, preprocess=PREPROCESS))
File "/var/lang/lib/python3.7/site-packages/fawkes/utils.py", line 230, in merge_faces
self.cloaked_faces[callback_id][bb[0]:bb[2], bb[1]:bb[3], :] += reshape_cloak
ValueError: operands could not be broadcast together with shapes (0,1479,3) (1582,1283,3) (0,1479,3) \n')

xirkus avatar May 10 '21 01:05 xirkus

Please try the 1.0.3 version uploaded to pypi.

This issue seems to be a upstream issue from the mtcnn package. Try install the newest mtcnn using this command: pip install git+https://github.com/ipazc/mtcnn.git#egg=mtcnn

Shawn-Shan avatar May 11 '21 02:05 Shawn-Shan

Does the 1.0.3 version on pypi include all of the changes in this repository? I didn't see an increment in the __init__.py. I'd like to understand which commit fixed the issue.

Also, looking at the error and code for merge_faces the error seems to be suggesting a numpy error with the matrix operations.

xirkus avatar May 11 '21 16:05 xirkus

Tested with the latest mtcnn as per your instructions with fawkes v.1.0.3 from pypi with exactly the same results.

xirkus avatar May 15 '21 17:05 xirkus

Tried with fawkes 0.3.2 and found that no errors were thrown for the same images. It seems that commit cfb34e1d39935d251abd2d82c2d1d8057c821afb introduced significant changes to the way faces are detected (which involved removal of David Sandberg's implementation).

It would be useful if you included the tests you used in this repo which shows that comparable behavior with regards to face detection is expected with the 1.0 release.

Otherwise, this represents a significant regression in functionality and prevents users from being able to correctly scrub more than a single face per image.

xirkus avatar May 15 '21 23:05 xirkus