Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SwinMM/Initialize the SwinMM project #296

Merged
merged 9 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions SwinMM/INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Installation

We provide installation instructions here.

## Setup

### Using Docker

The simplest way to use SwinMM is to use our docker image [`swinmm`](https://drive.google.com/file/d/1EGSoqN-HphyMV_gKUq-g7_BSwTTg35oA/view?usp=sharing), which has contained all the needed dependencies. Download the `swinmm.tar` into the `SwinMM` directory and try the following scripts:

```bash
cd SwinMM
docker import - swinmm < swinmm.tar
docker run --runtime=nvidia --gpus=all -m="800g" --shm-size="32g" -itd -v ./:/volume swinmm /bin/bash
docker exec -it swinmm /bin/bash
conda activate SwinMM
```

To use docker, make sure you have installed `docker` and `nvidia-docker`.

### Manual

For fast dataset loading, we required the users to install the Redis database, for example, on Ubuntu: `sudo apt-get install redis`

We also recommend the users install the PyTorch-based version from the official website.

Two packages are recommended to install manually according to their complicated dependencies: [bagua==0.9.2](https://github.com/BaguaSys/bagua), [monai==0.9.0](https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies)

The others can be installed through `pip install -r requirements.txt`

## Datasets

Our pre-training dataset includes 5833 volumes from 8 public datasets:

- [AbdomenCT-1K](https://github.com/JunMa11/AbdomenCT-1K)
- [BTCV](https://www.synapse.org/#!Synapse:syn3193805/wiki/217789)
- [MSD](http://medicaldecathlon.com/)
- [TCIACovid19](https://wiki.cancerimagingarchive.net/display/Public/CT+Images+in+COVID-19/)
- [WORD](https://github.com/HiLab-git/WORD)
- [TCIA-Colon](https://wiki.cancerimagingarchive.net/display/Public/CT+COLONOGRAPHY/)
- [LiDC](https://wiki.cancerimagingarchive.net/display/Public/LIDC-IDRI/)
- [HNSCC](https://wiki.cancerimagingarchive.net/display/Public/HNSCC)

We choose two popular datasets to test the downstream segmentation performance:

- [WORD](https://github.com/HiLab-git/WORD) (The Whole abdominal Organ Dataset)
- [ACDC](https://www.creatis.insa-lyon.fr/Challenge/acdc/#challenge/584e75606a3c77492fe91bba) (Automated Cardiac Diagnosis Challenge)

The dataset is organized as below:

```text
SwinMM
├── WORD
│ └── dataset
│ └── dataset12_WORD
│ ├── imagesTr
│ ├── imagesTs
│ ├── imagesVal
│ ├── labelsTr
│ ├── labelsTs
│ ├── labelsVal
│ └── dataset12_WORD.json
└── Pretrain
├── dataset
│ ├── dataset00_BTCV
│ ├── dataset02_Heart
│ ├── dataset03_Liver
│ ├── dataset04_Hippocampus
│ ├── dataset06_Lung
│ ├── dataset07_Pancreas
│ ├── dataset08_HepaticVessel
│ ├── dataset09_Spleen
│ ├── dataset10_Colon
│ ├── dataset11_TCIAcovid19
│ ├── dataset12_WORD
│ ├── dataset13_AbdomenCT-1K
│ ├── dataset_HNSCC
│ ├── dataset_TCIAcolon
│ └── dataset_LIDC
└── jsons
├── dataset00_BTCV.json
├── dataset01_BrainTumour.json
├── dataset02_Heart.json
├── dataset03_Liver.json
├── dataset04_Hippocampus.json
├── dataset05_Prostate.json
├── dataset06_Lung.json
├── dataset07_Pancreas.json
├── dataset08_HepaticVessel.json
├── dataset09_Spleen.json
├── dataset10_Colon.json
├── dataset11_TCIAcovid19.json
├── dataset12_WORD.json
├── dataset13_AbdomenCT-1K.json
├── dataset_HNSCC.json
├── dataset_TCIAcolon.json
└── dataset_LIDC.json

```
Empty file.
126 changes: 126 additions & 0 deletions SwinMM/Pretrain/jsons/dataset00_BTCV.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
{
"training": [
{
"image": "imagesTr/img0001.nii.gz",
"label": "labelsTr/label0001.nii.gz"
},
{
"image": "imagesTr/img0002.nii.gz",
"label": "labelsTr/label0002.nii.gz"
},
{
"image": "imagesTr/img0003.nii.gz",
"label": "labelsTr/label0003.nii.gz"
},
{
"image": "imagesTr/img0004.nii.gz",
"label": "labelsTr/label0004.nii.gz"
},
{
"image": "imagesTr/img0005.nii.gz",
"label": "labelsTr/label0005.nii.gz"
},
{
"image": "imagesTr/img0006.nii.gz",
"label": "labelsTr/label0006.nii.gz"
},
{
"image": "imagesTr/img0007.nii.gz",
"label": "labelsTr/label0007.nii.gz"
},
{
"image": "imagesTr/img0008.nii.gz",
"label": "labelsTr/label0008.nii.gz"
},
{
"image": "imagesTr/img0009.nii.gz",
"label": "labelsTr/label0009.nii.gz"
},
{
"image": "imagesTr/img0010.nii.gz",
"label": "labelsTr/label0010.nii.gz"
},
{
"image": "imagesTr/img0021.nii.gz",
"label": "labelsTr/label0021.nii.gz"
},
{
"image": "imagesTr/img0022.nii.gz",
"label": "labelsTr/label0022.nii.gz"
},
{
"image": "imagesTr/img0023.nii.gz",
"label": "labelsTr/label0023.nii.gz"
},
{
"image": "imagesTr/img0024.nii.gz",
"label": "labelsTr/label0024.nii.gz"
},
{
"image": "imagesTr/img0025.nii.gz",
"label": "labelsTr/label0025.nii.gz"
},
{
"image": "imagesTr/img0026.nii.gz",
"label": "labelsTr/label0026.nii.gz"
},
{
"image": "imagesTr/img0027.nii.gz",
"label": "labelsTr/label0027.nii.gz"
},
{
"image": "imagesTr/img0028.nii.gz",
"label": "labelsTr/label0028.nii.gz"
},
{
"image": "imagesTr/img0029.nii.gz",
"label": "labelsTr/label0029.nii.gz"
},
{
"image": "imagesTr/img0030.nii.gz",
"label": "labelsTr/label0030.nii.gz"
},
{
"image": "imagesTr/img0031.nii.gz",
"label": "labelsTr/label0031.nii.gz"
},
{
"image": "imagesTr/img0032.nii.gz",
"label": "labelsTr/label0032.nii.gz"
},
{
"image": "imagesTr/img0033.nii.gz",
"label": "labelsTr/label0033.nii.gz"
},
{
"image": "imagesTr/img0034.nii.gz",
"label": "labelsTr/label0034.nii.gz"
}
],
"validation": [
{
"image": "imagesTr/img0035.nii.gz",
"label": "labelsTr/label0035.nii.gz"
},
{
"image": "imagesTr/img0036.nii.gz",
"label": "labelsTr/label0036.nii.gz"
},
{
"image": "imagesTr/img0037.nii.gz",
"label": "labelsTr/label0037.nii.gz"
},
{
"image": "imagesTr/img0038.nii.gz",
"label": "labelsTr/label0038.nii.gz"
},
{
"image": "imagesTr/img0039.nii.gz",
"label": "labelsTr/label0039.nii.gz"
},
{
"image": "imagesTr/img0040.nii.gz",
"label": "labelsTr/label0040.nii.gz"
}
]
}
Loading