Skip to main content

AugLab investigates the influence of different data augmentation strategies on MRI training performance.

Project description

AugLab

This repository investigates the influence of different data augmentation strategies on MRI training performance.

What is available ?

This repository contains:

  • A nnUNet trainer with extensive data augmentations
  • A basic Monai segmentation script incorporating data augmentations
  • A script generating augmentations from input images and segmentations

How to install ?

  1. Open a bash terminal in the directory where you want to work.

  2. Create and activate a virtual environment using python >=3.10 (highly recommended):

    • venv
    python3 -m venv venv
    source venv/bin/activate
    
    • conda env
    conda create -n myenv python=3.10
    conda activate myenv
    
  3. Clone this repository:

    • Git clone
    git clone git@github.com:neuropoly/AugLab.git
    cd AugLab
    
  4. Install AugLab using one of the following commands:

    Note: If you pull a new version from GitHub, make sure to rerun this command with the flag --upgrade

    • nnunetv2 only usage
    python3 -m pip install -e .
    
    • full usage (with Monai and other dependencies)
    python3 -m pip install -e .[all]
    
  5. Install PyTorch following the instructions on their website. Be sure to add the --upgrade flag to your installation command to replace any existing PyTorch installation. Example:

python3 -m pip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cu118 --upgrade

Run nnunet training with AugLab trainer

To use the AugLab trainer with nnUNet, first add the trainer to your nnUNet installation by running:

auglab_add_nnunettrainer --trainer nnUNetTrainerDAExt

Then, when you run nnUNet training as usual, specifying the AugLab trainer, for example:

nnUNetv2_train 100 3d_fullres 0 -tr nnUNetTrainerDAExtGPU -p nnUNetPlans

You can also specify your data augmentation parameters by providing a JSON file using the environment variable AUGLAB_PARAMS_GPU_JSON:

Note: By default auglab/configs/transform_params_gpu.json is used if no file is specified.

AUGLAB_PARAMS_GPU_JSON=/path/to/your/params.json nnUNetv2_train 100 3d_fullres 0 -tr nnUNetTrainerDAExtGPU -p nnUNetPlans

⚠️ Warning : To avoid any paths issues, please specify an absolute path to your JSON file.

How to use my data ?

Scripts developped in this repository use JSON files to specify image and segmentation paths: see this example.

How do I specify my parameters ?

To track parameters used during data augmentation, JSON files are also used: see this example

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

auglab-20251124.tar.gz (56.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

auglab-20251124-py3-none-any.whl (63.0 kB view details)

Uploaded Python 3

File details

Details for the file auglab-20251124.tar.gz.

File metadata

  • Download URL: auglab-20251124.tar.gz
  • Upload date:
  • Size: 56.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for auglab-20251124.tar.gz
Algorithm Hash digest
SHA256 cfb7b5954d2ccd598bff21cc09b14596c1d087097e0c6e536b94b091bb1baed2
MD5 85956e1dfc35de00788a2fcbe7a71313
BLAKE2b-256 17d2587761f2900b2c3c99bb6a0bdbedf0c7777dc6d5aa33353c386595513842

See more details on using hashes here.

File details

Details for the file auglab-20251124-py3-none-any.whl.

File metadata

  • Download URL: auglab-20251124-py3-none-any.whl
  • Upload date:
  • Size: 63.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for auglab-20251124-py3-none-any.whl
Algorithm Hash digest
SHA256 425b891613cf5f25d7ccf4c262112b3af6909f5f8f1245fb7f12d7ac5cf99e1c
MD5 f5f2f5e0f12a98d7ed732ed0d453737b
BLAKE2b-256 005c4c11826656c82173bb1822e65a355b31d0f85222f1c08734e14e5cce0ec5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page