patrikhuber / superviseddescent

C++11 implementation of the supervised descent optimisation method
http://patrikhuber.github.io/superviseddescent/
Apache License 2.0
402 stars 188 forks source link

Error reading the RCR model "data/rcr/face_landmarks_model_rcr_22.bin": Failed to read 8 bytes from input stream! Read 0 #16

Closed avisingh599 closed 8 years ago

avisingh599 commented 8 years ago

Hi Patrick,

Awesome project, thanks for sharing it. I cloned the repository, and compiled it with cmake (with all the required libraries already installed). The compilation went fine, but when I try to run it, I get the following error:

Error reading the RCR model "data/rcr/face_landmarks_model_rcr_22.bin": Failed to read 8 bytes from input stream! Read 0

I am using Ubuntu 14.04. Also, I am testing it on OpenCV 3.0, but that does not seem to be problem here, as far as I can see.

Thanks, Avi

patrikhuber commented 8 years ago

Hi Avi!

Thank you! Hmm, are you running it from the build directory? In that case you need to adjust the path to the model. Can you try to run it by giving it the whole path to the model? E.g.:

rcr-detect -m /home/blabla/path_to_software/face_landmarks_model_rcr_22.bin

(and don't forget the rest of the arguments.)

Cheers, Patrik

avisingh599 commented 8 years ago

That works! Thanks a lot.

patrikhuber commented 8 years ago

Awesome!

(Just for reference: If you run the install target (don't forget to set CMAKE_INSTALL_PREFIX), then all files will get copied to the chosen install directory and the app will work as expected with default arguments.)

Edit: Opened #17 to improve the error message.

Patrik

Coding4mejie commented 8 years ago

Hi Patrick, @patrikhuber I meet the same error with avisingh599 ,but my problem is "data/rcr/face_landmarks_model_rcr_68.bin",but there's no 68.bin in the document,I am working on windows,could you tell me how to solve it? Thanks. Jie

patrikhuber commented 8 years ago

@Coding4mejie Can you try with the model under master/apps/rcr/data/face_landmarks_model_rcr_22.bin?

Alternatively, you can run it with the model from 4dface, which you can obtain either through there or from here.

I think in your case the issue is just that you're passing an invalid path to the app, make sure you pass a path to an actual model.

Coding4mejie commented 8 years ago

@patrikhuber Thanks for your help,I have another question,I hope your can help me.I compile the 4dface project,but the document downloaded from your github don't have ../share/haarcascade_frontalface_alt2.xml,where can I get this file?Sorry for having so many questions.

shrekdad commented 8 years ago

find the file in opencv directories, it's a model file for face detector.

patrikhuber commented 8 years ago

Yea, if you're on Ubuntu, just follow the manual: sudo apt-get install [...] opencv-data

Coding4mejie commented 8 years ago

@patrikhuber @datangguo Thank you.I have solve it.