Image Segmentation
prasb commited on
Commit
25e213a
Β·
verified Β·
1 Parent(s): 1bb972e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +68 -0
README.md CHANGED
@@ -70,6 +70,74 @@ MICCAI 2025 <br/>
70
  *Johns Hopkins University* <br/>
71
  <a href='https://www.zongweiz.com/dataset'><img src='https://img.shields.io/badge/Project-Page-Green'></a> <a href='https://www.cs.jhu.edu/~zongwei/publication/li2025pants.pdf'><img src='https://img.shields.io/badge/Paper-PDF-purple'></a>
72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  # Citations
74
  If you use this data, please cite the 2 papers below:
75
 
 
70
  *Johns Hopkins University* <br/>
71
  <a href='https://www.zongweiz.com/dataset'><img src='https://img.shields.io/badge/Project-Page-Green'></a> <a href='https://www.cs.jhu.edu/~zongwei/publication/li2025pants.pdf'><img src='https://img.shields.io/badge/Paper-PDF-purple'></a>
72
 
73
+
74
+
75
+
76
+ # Inference
77
+
78
+ **0- Download and installation.**
79
+
80
+
81
+ <details>
82
+ <summary style="margin-left: 25px;">[Optional] Install Anaconda on Linux</summary>
83
+ <div style="margin-left: 25px;">
84
+
85
+ ```bash
86
+ wget https://repo.anaconda.com/archive/Anaconda3-2024.06-1-Linux-x86_64.sh
87
+ bash Anaconda3-2024.06-1-Linux-x86_64.sh -b -p ./anaconda3
88
+ ./anaconda3/bin/conda init
89
+ source ~/.bashrc
90
+ ```
91
+ </div>
92
+ </details>
93
+
94
+ ```
95
+ git clone https://github.com/MrGiovanni/R-Super
96
+ cd R-Super/rsuper_train
97
+ conda create -n rsuper python=3.10
98
+ conda activate rsuper
99
+ pip install -r requirements.txt
100
+ pip install -U "huggingface_hub[cli]"
101
+ hf download AbdomenAtlas/MedFormerPanTS --local-dir ./MedFormerPanTS
102
+ ```
103
+
104
+ **1- Pre-processing.** Prepare your dataset in the format below. You can use symlinks instead of copying your data.
105
+ <details>
106
+ <summary style="margin-left: 25px;">Dataset format.</summary>
107
+ <div style="margin-left: 25px;">
108
+
109
+ ```
110
+ /path/to/dataset/
111
+ β”œβ”€β”€ BDMAP_0000001
112
+ | └── ct.nii.gz
113
+ β”œβ”€β”€ BDMAP_0000002
114
+ | └── ct.nii.gz
115
+ ...
116
+ ```
117
+ </div>
118
+ </details>
119
+
120
+ **2- Inference.** The code below will inference, generating binary segmentation masks. To save probabilities, add the argument --save_probabilities or --save_probabilities_lesions (which saves only probabilities for lesions, not for organs). The optional argument --organ_mask_on_lesion will use organ segmentations (produced by the R-Super model itself, not ground-truth) to remove tumor predictions outside its organ.
121
+
122
+ ```bash
123
+ python predict_abdomenatlas.py --load MedFormerPanTS/pants_pancreas_release/fold_0_latest.pth --img_path /path/to/test/dataset/ --class_list MedFormerPanTS/labels_pants.yaml --save_path /path/to/inference/output/ --organ_mask_on_lesion
124
+ ```
125
+ <details>
126
+ <summary style="margin-left: 25px;"> Argument Details </summary>
127
+ <div style="margin-left: 25px;">
128
+
129
+ - load: path to the model checkpoint (fold_0_latest.pth)
130
+ - img_path: path to dataset
131
+ - class_list: a yaml file with the class names of your model
132
+ - save_path: path to output, where masks will be saved
133
+ - ids: this is an optional argument. By default, the code will predict on all cases in --img_path. If you pass ids, the code will only test with the CT scans indicated in ids. You can use this to separate a test set: --ids /path/to/test/set/ids.csv. The csv file must have a 'BDMAP ID' column with the ids of the test cases.
134
+
135
+ </details>
136
+
137
+ For more details, see https://github.com/MrGiovanni/R-Super/tree/main/rsuper_train#test
138
+
139
+
140
+
141
  # Citations
142
  If you use this data, please cite the 2 papers below:
143