-
Notifications
You must be signed in to change notification settings - Fork 22
Command Line Arguments
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".
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
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
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
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'