Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError with numpy.ndarray #12

Open
petitcuckoo opened this issue Jul 31, 2019 · 3 comments
Open

RuntimeError with numpy.ndarray #12

petitcuckoo opened this issue Jul 31, 2019 · 3 comments

Comments

@petitcuckoo
Copy link

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
Copy link

I get the same error

@PeterWang512
Copy link
Owner

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
Copy link

qwop0462 commented Dec 2, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants