Command Line Arguments - thuiar/MMSA-FET GitHub Wiki

One way of using MMSA-FET is through commandline interface(CLI). Type python -m MSA_FET -h in a shell to print a brief help message.

MMSA-FET commanline tool contains three sub-commands, install, run_single and run_dataset. To see help message for sub-commands, use -h option after the command. e.g. python -m MSA_FET install -h.

Note that the package name is "MSA_FET" instead of "MMSA-FET".

1. General arguments

The package has a few overall arguments which will be applied to all sub-commands:

  • -v, --verbose, Print more information to stdout.
  • -q, --quiet, Print only errors to stdout.
  • --tmp-dir, Temporary directory for storing intermediate results. Default: ~/.MSA-FET/tmp
  • --log-dir, Log file directory. Default: ~/.MSA-FET/log

2. Sub-Command: install

Running sub-command install is required after pip install MMSA-FET. It downloads and extracts a few large models which cannot be packed into the installation package. There are 2 arguments:

  • -p, --proxy, Proxy for downloading. e.g. socks5://127.0.0.1:8080
  • -f, --force, Force re-download models.

Example:

$ python -m MSA_FET install -p socks5://127.0.0.1:8080

3. Sub-Command: run_single

This command is used to run feature extraction on a single video. It has 5 arguments:

  • -i, --input, Input video file.
  • -c, --config-file, Path to config file.
  • -o, --output, Path to output pkl file.
  • -t, --text-file, File containing transcriptions of the video. Required when extracting text features.
  • -r, --return-type, Return type. Valid choices: ['np', 'pt', 'df']. Default: 'np'

Example:

$ python -m MSA_FET run_single -i input.mp4 -c config.json -o output.pkl

4. Sub-Command: run_dataset

This command is used to run feature extraction on a dataset. It has 10 arguments:

  • -i, --input, Input dataset dir.
  • -c, --config-file, Path to config file.
  • -o, --output, Path to output pkl file.
  • -n, --num-workers, Num of dataloader workers. Default: 4
  • -b, --batch-size, Batch size. Default: 4
  • -r, --return-type, Return type. Valid choices: ['np', 'pt', 'df']. Default: 'np'
  • -s, --skip-bad-data, Skip bad data when loading dataset.
  • --pad-value Padding value for sequence padding. Valid choices: ['zero', 'norm']. Default: 'zero'
  • --pad-location Padding location for sequence padding. Valid choices: ['end', 'start']. Default: 'end'
  • --face-detection-failure, Action to take when face detection fails. 'skip' the frame or 'pad' with zeros. Default: 'skip'