Shawn-Shan / fawkes

Fawkes, privacy preserving tool against facial recognition systems. More info at https://sandlab.cs.uchicago.edu/fawkes

Home Page:https://sandlab.cs.uchicago.edu/fawkes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fawkes 1.0.2 exception thrown

xirkus opened this issue · 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')

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

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.

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

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.