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

io issue, could not open the image. #509

Open
ZuowenWang0000 opened this issue Jul 3, 2018 · 17 comments
Open

io issue, could not open the image. #509

ZuowenWang0000 opened this issue Jul 3, 2018 · 17 comments

Comments

@ZuowenWang0000
Copy link

ZuowenWang0000 commented Jul 3, 2018

Hello,
When I use LandmarkImg, neither operating on a single image from the samples folder nor sequence or images work. I got

Error: Could not open the image: ../samples/sample1.jpg

I don't know what to do with it since other functions work perfectly for videos. The error message is from OpenFace//lib/local/Utilities/src/ImageCapture.cpp

Another issue is I got this Could not find the HAAR face detector location both in video mode or image mode. But seems it doesn't affect the usage of video mode. But should this HAAR face detector being used heavily as the first step to detect the location of faces?

following are the error messages executing LandmarkImg. My environment is Ubuntu 16.04.
Thanks a lot!

LandmarkImg -fdir "../samples/" -wild
Attempting to read from directory: ../samples/
Could not find the HAAR face detector location
Loading the model
Reading the landmark detector/tracker from: ./bin/model/main_ceclm_general.txt
Reading the landmark detector module from: ./bin/model/cen_general.txt
Reading the PDM module from: ./bin/model/pdms/In-the-wild_aligned_PDM_68.txt....Done
Reading the Triangulations module from: ./bin/model/tris_68.txt....Done
Reading the intensity CEN patch experts from: ./bin/model/patch_experts/cen_patches_0.25_of.dat....Done
Reading the intensity CEN patch experts from: ./bin/model/patch_experts/cen_patches_0.35_of.dat....Done
Reading the intensity CEN patch experts from: ./bin/model/patch_experts/cen_patches_0.50_of.dat....Done
Reading the intensity CEN patch experts from: ./bin/model/patch_experts/cen_patches_1.00_of.dat....Done
Reading part based module....left_eye_28
Reading the landmark detector/tracker from: ./bin/model/model_eye/main_clnf_synth_left.txt
Reading the landmark detector module from: ./bin/model/model_eye/clnf_left_synth.txt
Reading the PDM module from: ./bin/model/model_eye/pdms/pdm_28_l_eye_3D_closed.txt....Done
Reading the intensity CCNF patch experts from: ./bin/model/model_eye/patch_experts/left_ccnf_patches_1.00_synth_lid_.txt....Done
Reading the intensity CCNF patch experts from: ./bin/model/model_eye/patch_experts/left_ccnf_patches_1.50_synth_lid_.txt....Done
Could not find the HAAR face detector location
Done
Reading part based module....right_eye_28
Reading the landmark detector/tracker from: ./bin/model/model_eye/main_clnf_synth_right.txt
Reading the landmark detector module from: ./bin/model/model_eye/clnf_right_synth.txt
Reading the PDM module from: ./bin/model/model_eye/pdms/pdm_28_eye_3D_closed.txt....Done
Reading the intensity CCNF patch experts from: ./bin/model/model_eye/patch_experts/ccnf_patches_1.00_synth_lid_.txt....Done
Reading the intensity CCNF patch experts from: ./bin/model/model_eye/patch_experts/ccnf_patches_1.50_synth_lid_.txt....Done
Could not find the HAAR face detector location
Done
Reading the landmark validation module....Done
Model loaded
Reading the AU analysis module from: ./bin/AU_predictors/main_static_svms.txt
Reading the AU predictors from: ./bin/AU_predictors/AU_all_static.txt... Done
Reading the PDM from: ./bin/AU_predictors/In-the-wild_aligned_PDM_68.txt... Done
Reading the triangulation from:./bin/AU_predictors/tris_68_full.txt... Done
Reading the MTCNN face detector from: ./bin/model/mtcnn_detector/MTCNN_detector.txt
Reading the PNet module from: ./bin/model/mtcnn_detector/PNet.dat
Reading the RNet module from: ./bin/model/mtcnn_detector/RNet.dat
Reading the ONet module from: ./bin/model/mtcnn_detector/ONet.dat
Error: Could not open the image: ../samples/sample1.jpg

@TadasBaltrusaitis
Copy link
Owner

Hi,

It should not be related to the HAAR face detector, as it is not used by default. As video processing is working, I'm wondering if you are missing certain libraries in OpenCV for decoding images, as OpenCV is used to open the images. Can you try using -f flag directly to open different format images, e.g. .png or .bmp?

@selvamQruize
Copy link

Reading the intensity CEN patch experts from: ./bin/model/patch_experts/cen_patches_0.35_of.dat....Could not find CEN patch experts, for instructions of how to download them, see https://github.com/TadasBaltrusaitis/OpenFace/wiki/Model-download

ERROR: Could not load the landmark detector

when i am loading to image , i got this error on ubuntu 16.04

@TadasBaltrusaitis
Copy link
Owner

Hi,

Did you follow that link and download the required models?

@butub1
Copy link

butub1 commented Jan 24, 2019

HI, i just got the same problem using both the .png format and jpeg/jpg format image,
Have you solved this problem yet?

and i have followed that link ,and download the required models ,

on ubuntu 16.04 , g++-4.9.3 opencv-3.4.0 boost-1.69

@TadasBaltrusaitis
Copy link
Owner

Does opening videos or a webcam work for you?

@karllacr
Copy link

karllacr commented Feb 5, 2019

FaceLandmarkVid worked for me, both in the case of videos contained in the directory and on the webcam. But in FaceLandmarkImg it gives the same error:
Error: could not open the image: ../samples/sample1.jpg

being the same error for all images. I even tried with other images that I put in the directory, but it did not worked. I checked the OpenCV library and everything is fine in it.

@seunghakbae
Copy link

I have same issue as well. Everything works fine except the FaceLandmarkImg. Did anybody find a solution to it? I tried with different images and it did not work.

@TadasBaltrusaitis
Copy link
Owner

That's quite strange and I can't reproduce the error. Does FeatureExtraction executable work? It can be used for processing images, FaceLandmarkImg is only intended for visualization of results. They both use the same way of opening images.

What are the exact command line arguments you are using?

@duckyngo
Copy link

duckyngo commented Jun 3, 2019

I used the command in the Unix install guide and had the same problem.

The command is : ./bin/FaceLandmarkImg -fdir "../samples/" -wild
or ./bin/FaceLandmarkImg -f "../samples/sample1.jpg" -wild

Both of them give the same error:
Model loaded Reading the AU analysis module from: ./bin/AU_predictors/main_static_svms.txt Reading the AU predictors from: ./bin/AU_predictors/AU_all_static.txt... Done Reading the PDM from: ./bin/AU_predictors/In-the-wild_aligned_PDM_68.txt... Done Reading the triangulation from:./bin/AU_predictors/tris_68_full.txt... Done Reading the MTCNN face detector from: ./bin/model/mtcnn_detector/MTCNN_detector.txt Reading the PNet module from: ./bin/model/mtcnn_detector/PNet.dat Reading the RNet module from: ./bin/model/mtcnn_detector/RNet.dat Reading the ONet module from: ./bin/model/mtcnn_detector/ONet.dat Error: Could not open the image: ../samples/sample1.jpg

It worked well on the Video. I also try to test with the FeatureExraction with the command:
./bin/FeatureExtraction -f "../samples/sample2.jpg"
It worked well too.

@TadasBaltrusaitis
Copy link
Owner

Could it be something with the image itself? You tried FeatureExtraction with sample2 but FaceLandmarkImg with sample1. Could you try both with both to see if this is causing the error.

@duckyngo
Copy link

duckyngo commented Jun 4, 2019

Thank for your quick response!.
I try both of them:
/bin/FaceLandmarkImg -f "../samples/sample2.jpg" -wild: the same issue occurred

./bin/FeatureExtraction -f "../samples/sample1.jpg" : It work normally

@TadasBaltrusaitis
Copy link
Owner

This seems like the problem is with the image loading library. FeatureExtraction using video loading library from OpenCV, while FaceLandmarkImg uses the image loading (imread). Possible that the dependencies for OpenCV were not installed or for some reason OpenCV cannot find them. Can you try reinstalling OpenCV?

@TadasBaltrusaitis
Copy link
Owner

Have you managed resolving the issue?

@tbikash62
Copy link

Hi

Running on Ubuntu -

Don't Have sudo or any executable access

The only way to install is conda env.

Have put the model files in right folders.

Since I don't have Executable info -
I got below instructions from others -

OpenFace Installation Steps.
The installation consists of OpenBlas, OpenCV, dlib, gcc and finally OpenFace installation
1.Follow instructions on https://github.com/TadasBaltrusaitis/OpenFace/wiki/Unix-Installation
2.For OpenBlas installation follow instructions on link: https://iq.opengenus.org/install-openblas-from-source/
3.Set correct path in file: FindOpenBLAS.cmake
4.Set correct path in file: OpenCVConfig.cmake during OpenCV installation
5.Set correct path in file OpenCVConfig-version.cmake
6.Set correct paths in cmake files and all other files in dlib, OpenCV, OpenBlas on the go, as error occurs.
7.In case of mpfr error check mpfr path using below command.
ldd /usr/libexec/gcc/x86_64-pc-linux-gnu/7.3.0/cc1 | grep mpfr

8.Create soft link on libmpfr.so using command ln –s in case of mpfr error.
9.Since, gcc 8 is required and it is not available without sudo permission, install gcc 7 using following command. Gcc of lower version doesn’t work.
conda install -c creditx gcc-7

WANTED TO KNOW STEP 3, 4, 5. How to give the path, I mean where to give the path.


Below is my error-

:~/OpenFace/build$ ./bin/FaceLandmarkVid -f "../samples/changeLighting.w
Could not find the HAAR face detector location
Reading the landmark detector/tracker from: ./bin/model/main_ceclm_general.txt
Reading the landmark detector module from: ./bin/model/cen_general.txt
Reading the PDM module from: ./bin/model/pdms/In-the-wild_aligned_PDM_68.txt....Done
Reading the Triangulations module from: ./bin/model/tris_68.txt....Done
Reading the intensity CEN patch experts from: ./bin/model/patch_experts/cen_patches_0.25_of.dat....D
Reading the intensity CEN patch experts from: ./bin/model/patch_experts/cen_patches_0.35_of.dat....D
Reading the intensity CEN patch experts from: ./bin/model/patch_experts/cen_patches_0.50_of.dat....D
Reading the intensity CEN patch experts from: ./bin/model/patch_experts/cen_patches_1.00_of.dat....D
Reading part based module....left_eye_28
Reading the landmark detector/tracker from: ./bin/model/model_eye/main_clnf_synth_left.txt
Reading the landmark detector module from: ./bin/model/model_eye/clnf_left_synth.txt
Reading the PDM module from: ./bin/model/model_eye/pdms/pdm_28_l_eye_3D_closed.txt....Done
Reading the intensity CCNF patch experts from: ./bin/model/model_eye/patch_experts/left_ccnf_patches
Reading the intensity CCNF patch experts from: ./bin/model/model_eye/patch_experts/left_ccnf_patches
Could not find the HAAR face detector location
Done
Reading part based module....right_eye_28
Reading the landmark detector/tracker from: ./bin/model/model_eye/main_clnf_synth_right.txt
Reading the landmark detector module from: ./bin/model/model_eye/clnf_right_synth.txt
Reading the PDM module from: ./bin/model/model_eye/pdms/pdm_28_eye_3D_closed.txt....Done
Reading the intensity CCNF patch experts from: ./bin/model/model_eye/patch_experts/ccnf_patches_1.00
Reading the intensity CCNF patch experts from: ./bin/model/model_eye/patch_experts/ccnf_patches_1.50
Could not find the HAAR face detector location
Done
Reading the landmark validation module....Done
Attempting to read from file: ../samples/changeLighting.wmv
VIDIOC_REQBUFS: Inappropriate ioctl for device
Failed to open the video file at location: ../samples/changeLighting.wmv

@AmelieGombeaud
Copy link

Hello, I have the same issue : VIDIOC_REQBUFS: Inappropriate ioctl for device. I have already re installed open CV. I am working on Linux, Ubuntu version 20.10.

Thanks in advance.

@Dongagent
Copy link

You can find the reference solution in #962.

Hello, I have the same issue : VIDIOC_REQBUFS: Inappropriate ioctl for device. I have already re installed open CV. I am working on Linux, Ubuntu version 20.10.

Thanks in advance.

@tashrifbillah
Copy link

VIDIOC_REQBUFS: Inappropriate ioctl for device

I have posted my solution here: opencv/opencv#14721 (comment)

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