Skip to content

AliTafakkor/algonauts2025

Repository files navigation

Algonuts2025

Ali Tafakkor, April 2025

Setup the environment using uv

  1. install uv
    pip install --user uv
    
  2. create the environment
    uv venv --python 3.12
    
  3. activate the environment
    source .venv/bin/activate
    
  4. install dependencies
    uv sync
    
  5. 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

Snakemake pipeline streamlines the feature extraction. The default rule extracts features for all movies files found using the specified models in the config.

Config

Config is broken down to three parts:

  1. Path Configs
  2. Feature Extraction configs
  3. Fusion Configs

Usage

Note

Make sure algonuts2025-workflow is the current directory. And the uv environment is activated.

  1. To get a dry run:
snakemake -np
  1. To get a specific feature file:
snakemake 'features/[model]/[collection]/[movie_filename]_features.npy'
  1. 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

CLI

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]

Available Commands

 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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published