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

Could not find the HAAR face detector location #1073

Open
Cb1ock opened this issue Jan 26, 2024 · 18 comments
Open

Could not find the HAAR face detector location #1073

Cb1ock opened this issue Jan 26, 2024 · 18 comments

Comments

@Cb1ock
Copy link

Cb1ock commented Jan 26, 2024

I follow the instruction step by step in https://github.com/TadasBaltrusaitis/OpenFace/wiki/Unix-Installation . And I did download the model as show in https://github.com/TadasBaltrusaitis/OpenFace/wiki/Model-download. BUT I STILL GOT THE ERROR here.

erroe message:

(base) ➜ build ./bin/FaceLandmarkVid -f "../samples/changeLighting.wmv" -f "../samples/2015-10-15-15-14.avi"
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....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

My device:

Ubuntu 20.04

@becomeGiant
Copy link

You just have to make it all over again.

@Cb1ock
Copy link
Author

Cb1ock commented Jan 31, 2024

You just have to make it all over again.

In fact, I have made it all over and over again.

@ismeyueyue
Copy link

ismeyueyue commented Feb 23, 2024

@Cb1ock Maybe you should also move the *.dat models you have downloaded to OpenFace/build/bin/model/patch_experts.

ref: https://github.com/TadasBaltrusaitis/OpenFace/wiki/Model-download

@brmarkus
Copy link

From these logs everything looks fine - the DAT files were found and loaded successfully.

What does the status then look like?
Do you see CPU-load increasing, is the application doing something, memory consumption increasing?
Is the application exiting?

Do you see the same behavior when using another video file (from the examples)?
Do you have a monitor connected (or display forwarding enabled)?

@ldxbxl
Copy link

ldxbxl commented Mar 25, 2024

From these logs everything looks fine - the DAT files were found and loaded successfully.

What does the status then look like? Do you see CPU-load increasing, is the application doing something, memory consumption increasing? Is the application exiting?

Do you see the same behavior when using another video file (from the examples)? Do you have a monitor connected (or display forwarding enabled)?

I can find any output in my file and I want to know how to deal with "Could not find the HAAR face detector location"

@brmarkus
Copy link

Which application are you trying to run, using which command-line arguments, which input files?
Do you specify which face-detector(s) to use, HAAR, HOG, CNN?

What does your environment - software and hardware - look like?

What happens with other inputs (images, videos)?

@ldxbxl
Copy link

ldxbxl commented Mar 25, 2024

Which application are you trying to run, using which command-line arguments, which input files? Do you specify which face-detector(s) to use, HAAR, HOG, CNN?

What does your environment - software and hardware - look like?

What happens with other inputs (images, videos)?

I just want to generate facial landmarks by using OpenFace and I follow the steps in the url https://github.com/TadasBaltrusaitis/OpenFace/wiki/Unix-Installation to install OpenFace.I use a personal laptop with ubuntu 18.04 installed. I input the videos from my own dataset by using the code"./FeatureExtraction -f -out_dir

-2Dfp". I really need to solve this problem.Please help me. Thank you!!!

@brmarkus
Copy link

Can you show the full command line with all parameters you are using again, please?
In your example aboce the path for the output directory seems missing?

@ldxbxl
Copy link

ldxbxl commented Mar 25, 2024

Can you show the full command line with all parameters you are using again, please? In your example aboce the path for the output directory seems missing?

./FeatureExtraction -f -out_dir

-2Dfp
The contents in <> <> are the video file path and the everywhere folder path, respectively

@ldxbxl
Copy link

ldxbxl commented Mar 25, 2024

Can you show the full command line with all parameters you are using again, please? In your example aboce the path for the output directory seems missing?

./FeatureExtraction -f <> -out_dir <> -2Dfp

@brmarkus
Copy link

Can you use one of the sample video files (some are "exotic" and almost for certain will use SW-video-codecs, i.e. wont rely on system-installed video-codecs)?
Can you remove -2Dfp and try again?
Can you try other parameters, like -pose (see also "https://github.com/TadasBaltrusaitis/OpenFace/wiki/Command-line-arguments"), just for consistency-check?
Does the out-dir path exists and is writable for the application (write-rights)?

@ldxbxl
Copy link

ldxbxl commented Mar 25, 2024

I tried your suggestion, using the.avi video in the samples folder, and the code runs like above. A .txt file and a .csv file are generated in the output path. I'm not sure if this is true, as I just got involved with the project today

@ldxbxl
Copy link

ldxbxl commented Mar 25, 2024

Can you use one of the sample video files (some are "exotic" and almost for certain will use SW-video-codecs, i.e. wont rely on system-installed video-codecs)? Can you remove -2Dfp and try again? Can you try other parameters, like -pose (see also "https://github.com/TadasBaltrusaitis/OpenFace/wiki/Command-line-arguments"), just for consistency-check? Does the out-dir path exists and is writable for the application (write-rights)?

“Could not find the HAAR face detector location ”still happen

@brmarkus
Copy link

I tried your suggestion, using the.avi video in the samples folder, and the code runs like above. A .txt file and a .csv file are generated in the output path. I'm not sure if this is true, as I just got involved with the project today

What do you mean...?
Using the sample-AVI file you do get the (expected) metadata-files, but using your video-/image-file you don't get the files?

The sample FeatureExtraction produces only textual metadata, not rendering, no GUI, no visualization. You could try the other samples (and/or GUI) to check the e.g. bounding-boxes.
And/or compare other tools, like "OpenVINO", like "DL-Streamer".

@brmarkus
Copy link

Can you use one of the sample video files (some are "exotic" and almost for certain will use SW-video-codecs, i.e. wont rely on system-installed video-codecs)? Can you remove -2Dfp and try again? Can you try other parameters, like -pose (see also "https://github.com/TadasBaltrusaitis/OpenFace/wiki/Command-line-arguments"), just for consistency-check? Does the out-dir path exists and is writable for the application (write-rights)?

“Could not find the HAAR face detector location ”still happen

This is expected - and from OpenCV; the installation instructions are not very clear about how to get the "HAAR model" from OpenCV.

@brmarkus
Copy link

As the script install.sh installs OpenCV, the HAAR classifier XML-files should be present.
If you want to give it a more detailed try, have a look at e.g. "https://docs.opencv.org/4.x/db/d28/tutorial_cascade_classifier.html" (or whatever version of OpenCV has been installed), look for e.g. "haarcascade_frontalface_alt.xml" or e.g. "haarcascade_eye_tree_eyeglasses.xml" under e.g. "lbpcascade_frontalface.xml".

(but I haven't checked the archive "https://github.com/opencv/opencv/archive/4.1.0.zip" from the install.sh script, if it really (still) contains the HAAR-classifier-files)

@ldxbxl
Copy link

ldxbxl commented Mar 25, 2024

I tried your suggestion, using the.avi video in the samples folder, and the code runs like above. A .txt file and a .csv file are generated in the output path. I'm not sure if this is true, as I just got involved with the project today

What do you mean...? Using the sample-AVI file you do get the (expected) metadata-files, but using your video-/image-file you don't get the files?

The sample FeatureExtraction produces only textual metadata, not rendering, no GUI, no visualization. You could try the other samples (and/or GUI) to check the e.g. bounding-boxes. And/or compare other tools, like "OpenVINO", like "DL-Streamer".

Sorry I didn't express my meaning clearly, I can also feature extract my own video now, there should be a problem with folder permissions. Thank you for your help

@brmarkus
Copy link

brmarkus commented Mar 25, 2024

(hmm, I would even say the HAAR detector cannot work... do I see it right that the variable haar_face_detector_location is not getting initialized, not filled with a path and filename?)

EDIT: No, sorry, I missed these lines:

		if (arguments[i].compare("-fdloc") ==0)
		{
			std::string face_detector_loc = arguments[i + 1];
			haar_face_detector_location = face_detector_loc;
			curr_face_detector = HAAR_DETECTOR;

Looks like with the command-line argument -fdloc you could specific the path to the HAAR classifier files (if you are able to find them)...

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

5 participants