PeterWang512 / FALdetector

Code for the paper: Detecting Photoshopped Faces by Scripting Photoshop
https://peterwang512.github.io/FALdetector/
Apache License 2.0
1.57k stars 233 forks source link

RuntimeError with numpy.ndarray #12

Open petitcuckoo opened 5 years ago

petitcuckoo commented 5 years ago

Thanks for your sharing the FALdetector code and careful installation instructions. However, one RuntimeError occurs when excluding the '--no_crop' options.

dets = cnn_face_detector(im, 0) RuntimeError: Expected writable numpy.ndarray with shape set.

What do I need to do to get it to work? Thanks : )

coscorrodrift commented 4 years ago

I get the same error

PeterWang512 commented 4 years ago

Can you try adding im.setflags(write=True) above that line (line 108 at utils/tools.py) and see if it works? If that doesn't work, probably try im = im.copy(); im.setflags(write=True)?

qwop0462 commented 3 years ago
im.setflags(write=True)
dets = cnn_face_detector(im, 0)

pip install numpy==1.15.1

but, i ran two commands: python global_classifier.py --input_path examples/modified.jpg --model_path weights/global.pth python local_detector.py --input_path examples/modified.jpg --model_path weights/local.pth --dest_folder out/

Results are both: no face detected by dlib, exiting