Companion code for OpenSRH. Paper submitted to NeurIPS 2022 Datasets and Benchmarks Track.
Paper Website / arXiv / MLiNS Lab
- Clone OpenSRH github repo
git clone [email protected]:MLNeurosurg/opensrh.git
- Install miniconda: follow instructions here
- Create conda environment
conda create -n opensrh python=3.9
- Activate conda environment
conda activate opensrh
- Install package and dependencies
<cd /path/to/opensrh/repo/dir> pip install -e .
- opensrh: the library for training with OpenSRH
- datasets: PyTorch datasets to work with the data release
- losses: loss functions for contrastive learning
- models: PyTorch networks for training and evaluation
- train: training and evaluation scrpits
- README.md
- LICENSE
The code base is written using PyTorch Lightning, with custom network and datasets.
- Download and uncompress the data.
- Update the sample config file in
train/config/train_ce.yaml
with desired configurations. - Change directory to
train
and activate the conda virtual environment. - Use
train/train_ce.py
to start training:python train_ce.py -c config/train_ce.yaml
- Download and uncompress the data.
- Update the sample config file in
train/config/train_contrastive.yaml
with desired configurations. - Change directory to
train
and activate the conda virtual environment. - Use
train/train_contrastive.py
to start training:python train_contrastive.py -c config/train_contrastive.yaml
- To run linear or finetuning protocol, update the config file
train/config/train_finetune.yaml
and continue training usingtrain/train_finetune.py
:python train_finetune.py -c config/train_finetune.yaml
- Update the sample config file in
train/config/eval.yaml
with desired configurations, including the PyTorch Lightning checkpoint you would like to use. - Change directory to
train
and activate the conda virtual environment. - Use
train/train_ce.py
to start training:python eval.py -c config/eval.yaml
OpenSRH data is released under Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0), and the code is licensed under the MIT License. See LICENSE for license information and THIRD_PARTY for third party notices.