TadasBaltrusaitis / OpenFace

OpenFace – a state-of-the art tool intended for facial landmark detection, head pose estimation, facial action unit recognition, and eye-gaze estimation.
Other
6.71k stars 1.82k forks source link

Could not find the HAAR face detector location #1073

Open Cb1ock opened 5 months ago

Cb1ock commented 5 months ago

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 commented 4 months ago

You just have to make it all over again.

Cb1ock commented 4 months ago

You just have to make it all over again.

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

ismeyueyue commented 4 months ago

@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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

(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)...