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.86k stars 1.84k forks source link

No documentation for option to choose face detector #1081

Closed Allexxann closed 1 month ago

Allexxann commented 6 months ago

The GUI has 3 options for Face Detector and 3 options for Landmark Detector. The command line parameters here list only a single model input with several different models, names sligtly off from the GUI. These do not map onto each other.

How do I actually specify both detectors through command line?

brmarkus commented 6 months ago

Are you referring to "https://github.com/TadasBaltrusaitis/OpenFace/wiki/Command-line-arguments#documentation"?

Finally you might need to look into the implementation of the different samples/GUIs, like "https://github.com/TadasBaltrusaitis/OpenFace/blob/master/exe/FaceLandmarkImg/FaceLandmarkImg.cpp".

Allexxann commented 6 months ago

Here: https://github.com/TadasBaltrusaitis/OpenFace/wiki/Command-line-arguments#common-parameters-for-all Only one "-mloc" and it's all about landmark detection. GUI also has different options for face detection.

I don't know C/C++, so that gives me nothing. Also, I like this GUI just fine. I just need to replicate all the parameters through command line - first I use the GUI to find the most useful combination of settings, then I batch process all the videos in my dataset with it.

brmarkus commented 6 months ago

Can you maybe rephrase your question @Allexxann ?

Which GUI executable are you talking about? We might want to check the code together to find all supported command-line arguments.

Are you asking about undocumented/outdated command-line arguments or do you want options from within the GUI only to be exposed as command-line parameters?

Allexxann commented 6 months ago

I simply use OpenFaceOffline.exe as a GUI executable, but from what I understand it simply passes the same calls internally. Since I work with single-face videos, I'll need FeatureExtraction for command line input, I guess.

Hm, I honestly thought these options were already exposed, just not documented on that page.

Okay, more specific. I want to know command line arguments

So that I could use through command line the mode I chose in GUI.

Everything else is mostly covered and is matched between documentation and GUI.

brmarkus commented 6 months ago

From what I can see in the files under "https://github.com/TadasBaltrusaitis/OpenFace/tree/master/gui/OpenFaceOffline" it looks like this GUI executable doesn't handle any command-line options, when I interpret the C# code correctly...

Everything seems hard-wired and only changable at runtime via the GUI...

Allexxann commented 6 months ago

OpenFaceOffline lacks console input, as it should, since it's a GUI integrator. And FeatureExtraction lacks the GUI and operates through command line or being called by OpenFaceOffline. That much I could tell you from the start.

Also I already checked FeatureExtraction (just a full-text regex search), and couldn't find any of the parameters listed in documentation, meaning that they're either handled elsewhere or encoded in a non-obvious way (I still know nothing about C++ and how it handles input).

You could check OpenFaceOffline for command line outputs/external calls, or variables set by choosing the options in GUI.

brmarkus commented 6 months ago

FeatureExtraction forwards the command-line arguments to various sub-modules, spread all over the repo:

LandmarkDetector::FaceModelParameters det_parameters(arguments);
FaceAnalysis::FaceAnalyserParameters face_analysis_params(arguments);
Utilities::Visualizer visualizer(arguments);
Utilities::RecorderOpenFaceParameters recording_params(arguments,... ...
Utilities::RecorderOpenFace open_face_rec(sequence_reader.name, recording_params, arguments);

The GUI OpenFaceOffline, however, supports all sub-modules, which then can be used via GUI buttons.

Hmm, still not sure I get your intention... After finetuning the results with one of the GUI-tools you want to use one of the other executable, e.g. "https://github.com/TadasBaltrusaitis/OpenFace/tree/master/exe/FeatureExtraction", to do batching. But you are missing command-line options for e.g. "FeatureExtraction.exe" or don't know their exact name?

Allexxann commented 6 months ago

Basically your last statement. I'm sure the option for specifying face detector is already here, but the name is absent in the doc. I just need the name of the parameter and the possible values for it.

It would be nice to confirm that "-mloc" is the option for landmark detector, though, just to be sure.

brmarkus commented 6 months ago

The latest version of "https://github.com/TadasBaltrusaitis/OpenFace/tree/master/gui/OpenFaceOffline" on the master branch doesn't consider any command line arguments, as far as I can see.

Allexxann commented 6 months ago

"After finetuning the results with one of the GUI-tools you want to use one of the other executable, e.g. "https://github.com/TadasBaltrusaitis/OpenFace/tree/master/exe/FeatureExtraction", to do batching. But you are missing command-line options for e.g. "FeatureExtraction.exe" or don't know their exact name?"

I need arguments to pass to FeatureExtraction, which it passes further, but I don't know their exact name. OpenFaceOffline is generating these arguments, not receiving them. At least, that's what it looks like from the user point of view.

brmarkus commented 4 months ago

Were you able to achieve what you were looking for, have you added your needed command line arguments and use them instead of the hard-coded parameters in this sample?

Allexxann commented 4 months ago

I tried to screw around with the source code, understood I have no hope before my deadline in making sense of C/C++, which I never studied before, then just used the default settings and hoped for the best.

Allexxann commented 1 month ago

First, the answer to my original question is not documented, but I hired a real c++ coder for a little detective work.

Supplying -fdloc "classifiers/haarcascade_frontalface_alt.xml" to FeatureExtraction forces the program to use Haar. There are several different xml's here, so you can choose whichever suits you. Supplying -wild makes it use MTCNN. If -wild is used, but it cannot find the file "model/mtcnn_detector/MTCNN_detector.txt", it will default to HOG instead.

Second, bmarkus, you're a fucking moron, and your "help" was less than useless. It is a big temptation to make yourself look clever without actually turning your brain on, but consider hanging yourself next time instead.

kendrew06 commented 1 month ago

您的邮件我已收到,有需要会尽快回复This is an automatic reply, confirming that your e-mail was received.Thank you