https://github.com/hilab-git/iplc
https://github.com/hilab-git/iplc
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/hilab-git/iplc
- Owner: HiLab-git
- Created: 2024-07-02T08:00:19.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-03T13:59:58.000Z (over 1 year ago)
- Last Synced: 2025-03-20T21:38:01.670Z (about 1 year ago)
- Language: Python
- Size: 1.34 MB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## IPLC
## 👉 Requirements
Non-exhaustive list:
* python3.9+
* Pytorch 1.10.1
* nibabel
* Scipy
* NumPy
* Scikit-image
* yaml
* tqdm
* pandas
* scikit-image
* SimpleITK
## 👉 Usage
1. Download the [M&MS Dataset](http://www.ub.edu/mnms), and organize the dataset directory structure as follows:
```
your/data_root/
train/
img/
A/
A0S9V9_0.nii.gz
...
B/
C/
...
lab/
A/
A0S9V9_0_gt.nii.gz
...
B/
C/
...
valid/
img/
lab/
test/
img/
lab/
```
The network takes nii files as an input. The gt folder contains gray-scale images of the ground-truth, where the gray-scale level is the number of the class (0,1,...K).
2. Download the [SAM-Med2D model](https://drive.google.com/file/d/1ARiB5RkSsWmAB_8mqWnwDF8ZKTtFwsjl/view?usp=drive_link) and move the model to the "your_root/pretrain_model" directory in your project.
3. Train the source model in the source domain, for instance, you can train the source model using domain A on the M&MS dataset:
```
python train_source.py --config "./config/train2d_source.cfg"
```
4. Adapt the source model to the target domain, for instance, you can adapt the source model to domain B on the M&MS dataset:
```
python adapt_mian.py --config "./config/adapt.cfg"
```
## 🤝 Acknowledgement
- Thanks to the open-source of the following projects: [Segment Anything](https://github.com/facebookresearch/segment-anything); [SAM-Med2D](https://github.com/cv-chaitali/SAM-Med2D)