conda create --name meb_env python=3.10
git clone https://github.com/tvaranka/meb
cd meb
pip install -e .
Due to private data (faces) appearing in micro-expression datasets they are only available after accepting the release agreement. See Micro-expression datasets for more information on where to obtain the datasets.
The datasets can be added to the framework by two ways. It is recommended to start by just adding the excel_path
and dataset_path
(or cropped or optical_flow) for a single dataset and testing whether it works with the instructions below. If the test passes, you can proceed with adding other datasets and sources. See tools on how to obtain optical flow and cropped datasets.
The DatasetConfig
consists of all the paths to the datasets. Each dataset has four different paths: excel_path
, cropped_dataset_path
, dataset_path
and optical_flow
paths. The variable names in the DatasetConfig
should not be changed, but the paths can be changed freely.
class DatasetConfig:
"""Used as a config file for storing dataset information"""
smic_excel_path = "data/SMIC/smic.xlsx"
smic_cropped_dataset_path = "data/SMIC/SMIC_all_cropped/HS"
smic_dataset_path = "data/SMIC/HS"
smic_optical_flow = "data/SMIC/smic_uv_frames_secrets_of_OF.npy"
...
OR
Create symbolic links to match the ones in config/dataset_config.py
. Change the paths starting with "my_path" to match yours. This example uses linux, use mklink /D {my_path} {link_path}
for windows.
ln -sfn "my_path/micro_expressions/SMIC/Original data/smic.xlsx" "data/SMIC/smic.xlsx"
ln -sfn "my_path/micro_expressions/SMIC/Preprocessed data/SMIC_all_cropped/HS" "data/SMIC/SMIC_all_cropped/HS"
ln -sfn "my_path/micro_expressions/SMIC/Original data/HS" "data/SMIC/HS"
ln -sfn "my_path/micro_expressions/SMIC/Preprocessed data/smic_uv_frames_secrets_of_OF.npy" "data/SMIC/smic_uv_frames_secrets_of_OF.npy"
See tools/create_sym_links.sh
for the whole script.
To test if the data addition was succesfull run the tools/dataset_setup_test.py
. As arguments the scripts takes --dataset_name
from the following list [Smic/Casme/Casme2/Samm/Mmew/Fourd/Casme3A/Casme3C/Megc/CrossDataset] (note the capitalization) and --data_type
from the list [original/cropped/optical_flow].
python tools/dataset_setup_test.py --dataset_name Smic --data_type optical_flow
If the loading was succesfull you should see a shape of the first sample of the dataset. If it was unsuccesfull you should see a FileNotFoundError
. (Note: you may see some warnings if the image data is inconsistent with the metadata)
See documentation on datasets, configs and validation or browse the experiments
folder to find more examples.