Ali Tafakkor, April 2025
- install uv
pip install --user uv
- create the environment
uv venv --python 3.12
- activate the environment
source .venv/bin/activate
- install dependencies
uv sync
- manually install torch_audioset mainly for YAMNet's pytorch implementation
git clone https://github.com/w-hc/torch_audioset.git cd torch_audioset uv pip install -e .
Snakemake pipeline streamlines the feature extraction. The default rule extracts features for all movies files found using the specified models in the config.
Config is broken down to three parts:
- Path Configs
- Feature Extraction configs
- Fusion Configs
Note
Make sure algonuts2025-workflow
is the current directory. And the uv environment is activated.
- To get a dry run:
snakemake -np
- To get a specific feature file:
snakemake 'features/[model]/[collection]/[movie_filename]_features.npy'
- To get all feature files (current default rule):
snakemake -c10
number of cores are specified to prevent GPU OOM error, should be reduced if the GPU has less memory.
[!TODO] Write a cli for the snakemake common uses
A command-line interface (CLI) is provided using Typer for common tasks.
You can run the CLI from the project root with:
python main.py [COMMAND] [OPTIONS]
Usage: main.py [OPTIONS] COMMAND [ARGS]...
╭─ Options ────────────────────────────────────────────────────────────────────────────╮
│ --install-completion Install completion for the current shell. │
│ --show-completion Show completion for the current shell, to copy it or │
│ customize the installation. │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────────────╮
│ extract-features Run the snakemake pipeline to extract features. │
│ prep Prepare the subject's data for training and validation. │
│ train │
│ predict │
╰──────────────────────────────────────────────────────────────────────────────────────╯
Tip
Use python main.py --help
or python main.py [COMMAND] --help
to see all available options and help for each command.