Skip to main content

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 .[nnunetv2]
    
    • 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

Metadata

Release files for auglab 20260109

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for auglab 20260109
File Size Uploaded
auglab-20260109.tar.gz 62.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for auglab 20260109
File Interpreter ABI Platform
auglab-20260109-py3-none-any.whl Python 3 none any Details

Total release size: 132.4 kB

Release files / auglab-20260109.tar.gz

Download URL auglab-20260109.tar.gz
Size 62.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e9601ff977de852a2463dffeec6dbef354f70f9dfadbfaf1c40f8b393489080f
BLAKE2b-256 checksum
How to use checksums
6b67b2b2980c9b9dfbbed76229da58abf709e72c305e9794844066ee735f5ff9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.19

Release files / auglab-20260109-py3-none-any.whl

Download URL auglab-20260109-py3-none-any.whl
Size 69.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c35733eca7d010530957e6cee3209625c2fdbdd38e0584695f1e0cec225ea9c
BLAKE2b-256 checksum
How to use checksums
cac313cd9e80e1891527a09603e9ca9a9d2baa65ae9e9981bd65dee55afdc514
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.19

Release history Release notifications | RSS feed

This release

20260109 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page