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

How to turn off the display before building OpenFace? #1076

Closed ismeyueyue closed 4 months ago

ismeyueyue commented 4 months ago

Describe the bug

I have successfully installed OpenFace on my server (Python application) which lack of GUI.

However, when run the test demo on videos, an error of display occurred as below run

./bin/FaceLandmarkVid -f "../samples/changeLighting.wmv" -f "../samples/2015-10-15-15-14.avi"

get error msg:

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....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
Attempting to read from file: ../samples/changeLighting.wmv
Device or file opened
Starting tracking
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

(tracking result:66010): Gtk-WARNING **: 19:04:15.093: cannot open display:

Therefore, if there is an option to turn off the display before building OpenFace? I just need save the landmark detection results.

Thanks.

brmarkus commented 4 months ago

The mentioned sample has a GUI, using OpenCV to display images/frames. Have you tried using the sample `FeatureExtraction´ instead? You could disable all the visualizations via command line arguments:

-vis-track visualise the tracked face
-vis-hog visualise the HOG features
-vis-align visualise similarity aligned faces
-vis-aus visualise Action Units

(all from "https://github.com/TadasBaltrusaitis/OpenFace/wiki/Command-line-arguments")

But I haven't tried it just now...

ismeyueyue commented 4 months ago

thanks for you replay! The FeatureExtraction commond is work for me, which has save the detect .csv result.

The arguments like -vis-track is just turn on the visualise the tracked face, and no relevant way to turn off these visualizations...

The mentioned sample has a GUI, using OpenCV to display images/frames. Have you tried using the sample `FeatureExtraction´ instead? You could disable all the visualizations via command line arguments:

-vis-track visualise the tracked face
-vis-hog visualise the HOG features
-vis-align visualise similarity aligned faces
-vis-aus visualise Action Units

(all from "https://github.com/TadasBaltrusaitis/OpenFace/wiki/Command-line-arguments")

But I haven't tried it just now...