Skip to content

Command line arguments

Tadas Baltrusaitis edited this page Oct 15, 2017 · 35 revisions

Best way to see how the command line arguments work is through looking at ./matlab_runners/Demos/ which illustrates how each of the models is called

FaceLandmarkVid and FaceLandmarkVidMulti

Parameters for input

-f <filename> the video file being input, can specify multiple files

-device <device_num> the webcam from which to read images (default 0)

-fd <depth directory> the directory where depth files are stored (deprecated)

-root <directory> the root of input and output so -f and -ov can be specified relative to it

-inroot <directory> the root of input so -f can be specified relative to it

-outroot <directory> the root of output so -ov can be specified relative to it

Parameters for output

-ov <location of visualized track> where to output video file with tracked landmarks

-oc <FOURCC_CODE> the codec of the output video file (list of FOURCC codes can be found here - https://www.fourcc.org/codecs.php)

FaceLandmarkImg

Single image analysis

-f <filename> the image file being input, can have multiple -f flags

-of <filename> location of output file for landmark points, gaze and action units

-op <filename> location of output file for 3D landmark points and head pose

-gaze indicate that gaze estimation should be performed

-oi <filename> location of output image with landmarks

-root <dir> the root directory so -f, -of, -op, and -oi can be specified relative to it

-inroot <dir> the input root directory so -f can be specified relative to it

-outroot <dir> the root directory so -of, -op, and -oi can be specified relative to it

Batch image analysis

-fdir <directory> - runs landmark detection on all images (.jpg and .png) in a directory, if the directory contains .txt files (image_name.txt) with bounding box (min_x min_y max_x max_y), it will use those for initialisation

-ofdir <directory> directory where detected landmarks, gaze, and action units should be written

-oidir <directory> directory where images with detected landmarks should be stored

-opdir <directory> directory where pose files are output (3D landmarks in images together with head pose and gaze)

For more details on output format see here

FeatureExtraction

Input parameters

-f <filename> the video file being input, can specify multiple -f

-fdir <directory> run the feature extraction on every image (.jpg and .png) in a directory (the output will be stored in individual files for the whole directory)

-asvid if this flag is specified the images in -fdir directory will be treated as if they came from a video, that is they form a sequence, so tracking will be done instead of detection per videos)

-root <dir> the root for input and output

-inroot <dir> the root for input

-au_static if this flag is specified the AU prediction will be performed as if on static images rather than videos, see here for a more detailed explanation

Parameters for output (for more details on output format see here)

-outroot <dir> the root directory relevant to which the output files are created

-of <filename> location of file

-ov <filename> location location of tracked output video

-oc <FOURCC_CODE> the codec of the output video file (list of FOURCC codes can be found here - https://www.fourcc.org/codecs.php)

-hogalign <filename> output HOG feature location, outputs HOG in a binary file format (see ./matlab_runners/Demos/Read_HOG_files.m for a script to read it in Matlab)

-simalign <output directory> output directory for aligned face images, outputs a similarity aligned and cropped face for further analysis

-world_coord <1/0> should rotation be measured with respect to the camera or world coordinates

Additional parameters for output

-verbose visualise the processing steps live: tracked face with gaze, similarity aligned face, and HOG feaures (not visualized by default), this flag turns all of them on, below flags allow for more fine-grained control

-vis-track visualise the tracked face

-vis-hog visualise the HOG features

-vis-align visualise similarity aligned faces

-q supress any live visualisation (this supresses all the other visualization flags)

-simscale <float> scale of the face for similarity alignment (default 0.7)

-simsize <int> width and height of image in pixels when similarity aligned (default 112)

-g output images should be grayscale (for saving space)

You might not always want to extract all the output features (gaze, Action Units, landmarks, pose, etc.), you can restrict output using the following flags:

-no2Dfp do not output 2D landmarks in pixels

-no3Dfp do not output 3D landmarks in milimeters

-noMparams do not output rigid and non-rigid shape parameters

-noPose do not output head pose (location and rotation)

-noAUs do not output the Facial Action Units

-noGaze do not output eye gaze

Common parameters for all

-q specifying to use quiet mode not visualizing output

Model to use parameters

-mloc <the location of landmark detection models>

Options for this:

  • "model/main_clnf_general.txt" (default) - trained on Multi-PIE of varying pose and illumination and In-the-wild data, works well for head pose tracking (CLNF model)
  • "model/main_clnf_wild.txt" - trained on In-the-wild data, works better in noisy environments (not very well suited for head pose tracking), (CLNF in-the-wild model)
  • "model/main_clm_general.txt" - a less accurate but slightly faster CLM model trained on Multi-PIE of varying pose and illumination and In-the-wild data, works well for head pose tracking
  • "model/main_clm-z.txt" - trained on Multi-PIE and BU-4DFE datasets, works with both intensity and depth signals (CLM-Z)

Model parameters

-wild flag specifies when the images are more difficult, model considers extended search regions

-multi-view <0/1> should multi-view initialisation be used (more robust, but slower), off by default

Optional camera parameters for proper head pose and eye gaze computation

-fx <focal length in x>
-fy <focal length in y>
-cx <optical centre in x> 
-cy <optical centre in y>
Clone this wiki locally