- Install the needed requirements e.g. using pip:
pip install -r requirements.txt- Create your own local .envfile by copying the distributed file.
cp .env.dist .env- 
Put the affectnet dataset into ./data/affectnetand the rafdb dataset into./data/raf_db. The given validation set should be put into./data/test. You can also change the paths in.envto your liking.
- 
Execute the main.py. Each subcommand also has a--helpentry.
python main.py --help- Try the live video demonstration using your webcam and the already downloaded model.
python main.py demo fu11xlluFurther fully trained models can be downloaded from here.
python main.py inference <model-identifier> <input-path> <output-path>Arguments:
- <model-identifier>specifies the model either by architecture or by W&B ID
- <input-path>root for all pictures to be tested
- <output-path>destination for- .csvwith results
python main.py trainOptional Arguments:
- <offline>if you want to train offline (e.g. without W&B), default is- False
python main.py analyze <model-identifier>Optional Arguments:
- <data-path>path to the data to be analyzed, default is the validation set (see- .env)
python main.py demo <model-identifier>Optional arguments:
- <webcam>use webcam as input, default is- False
- cam-idspecify the webcam id, default is- 0
- <input-video>set a video file as input, required if not using webcam, will also generate an output video
- <show-processing>show the processing of the video, default is- True
- <explainability>show the explanation of the prediction, default is- False
- <landmarks>show remarkable landmarks, default is- False
- <info>show information about the prediction, default is- True
- <codec>specify the fourcc codec for the output video, default is- XVID
- <output-extension>specify the output extension for the video, default is- avi, depending on the codec
python main.py explain <model_name> --method <method> --window <window> --data-path <data-path> --examples <examples> --random <random> --path-contains <path-contains> --save-path <save-path>Arguments:
- <model_name>The identifier of the model to explain
Optional Arguments:
- <method>Specify the visual explanation method (default: 'gradcam')
- <window>The size of the window for the explanation (default: 8)
- <data-path>The path to the dataset for testing (default: value from environment variable DATASET_TEST_PATH)
- <examples>The number of examples to explain (default: 5)
- <random>Whether to choose examples randomly (default: True)
- <path-contains>Specify a string that the example paths must contain (default: "")
- <save-path>The path to save the explanation results (default: None)
python main.py explain_image <model-name> --window <window> --data-path <data-path> --path_contains <path-contains> --save-path <save-path>Arguments:
- <model-name>The identifier of the model to explain
Optional Arguments
- <window>The size of the window for the explanation (default: 8)
- <data-path>: The path to the dataset for testing (default: value from environment variable DATASET_TEST_PATH)
- <path-contains>Specify a string that the example paths must contain (default: "")
- <save-path>The path to save the explanation results (default: None)
python main.py pca <model-name> --data-path <data-path> --softmax <softmax>Arguments:
- <model-name>The identifier of the model to visualize PCA
Optional Arguments:
- <data-path>The path to the dataset for testing (default: value from environment variable DATASET_TEST_PATH)
- <softmax>Whether to apply softmax activation before plotting (default: False)
python main.py clipOptional Arguments:
- <output-dir>directory to store the clipped faces, default is the path to the AffectNet dataset as specified in- .env
- <use-rafdb-format>use the RAF-DB format for the output, default is- False
python main.py ensembleOptional Arguments:
- <data-path>path to the data to be analyzed, default is the validation set (see- .env)
python main.py sweepOptional Arguments:
- <count>number of runs to be performed on the sweep
- <sweep-id>sweep id
- sweep config to be defined in sweep.py
python main.py true-value-distributions <model-identifier>Optional Arguments:
- <data_path>path to the data to be get the true value distributions from, default set to RAF-DB (see- .env)
- <output_path>path for distributions and plots to be saved, default set to activation_values (see- .env)
kl-analyze <model-identifier>Optional arguments:
- <data_path>path to the data to be get the true value distributions from, default set to validation set (see- .env)
- <output_path>path for distributions and plots to be saved, default set to activation_values (see- .env)