Spaces:
Runtime error
Runtime error
Anirudh Balaraman commited on
Update README.md
Browse files
README.md
CHANGED
|
@@ -35,14 +35,14 @@ Deep learning methods used in medical AI—particularly for csPCa prediction and
|
|
| 35 |
|
| 36 |
|
| 37 |
## 🚀 Quick Start
|
| 38 |
-
1. Clone and Setup
|
| 39 |
```bash
|
| 40 |
git clone https://github.com/anirudhbalaraman/WSAttention-Prostate.git
|
| 41 |
cd WSAttention-Prostate
|
| 42 |
pip install -r requirements.txt
|
| 43 |
pytest tests/
|
| 44 |
```
|
| 45 |
-
2. Model Download
|
| 46 |
|
| 47 |
```bash
|
| 48 |
mkdir -p ./models
|
|
@@ -52,14 +52,27 @@ curl -L -o models/file3.pth https://huggingface.co/anirudh0410/WSAttention-Prost
|
|
| 52 |
```
|
| 53 |
|
| 54 |
## 🚀 Usage
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
|
| 56 |
### Preprocessing
|
| 57 |
|
|
|
|
| 58 |
```bash
|
| 59 |
-
python preprocess_main.py
|
| 60 |
-
|
|
|
|
| 61 |
```
|
| 62 |
|
|
|
|
| 63 |
### PI-RADS Training
|
| 64 |
|
| 65 |
```bash
|
|
@@ -71,12 +84,11 @@ python run_pirads.py --mode train --config config/config_pirads_train.yaml
|
|
| 71 |
```bash
|
| 72 |
python run_cspca.py --mode train --config config/config_cspca_train.yaml
|
| 73 |
```
|
| 74 |
-
|
| 75 |
-
### Inference
|
| 76 |
|
| 77 |
```bash
|
| 78 |
-
python run_pirads.py --mode test --config config/config_pirads_test.yaml
|
| 79 |
-
python run_cspca.py --mode test --config config/config_cspca_test.yaml
|
| 80 |
python run_inference.py --config config/config_preprocess.yaml
|
| 81 |
```
|
| 82 |
|
|
|
|
| 35 |
|
| 36 |
|
| 37 |
## 🚀 Quick Start
|
| 38 |
+
### 1. Clone and Setup
|
| 39 |
```bash
|
| 40 |
git clone https://github.com/anirudhbalaraman/WSAttention-Prostate.git
|
| 41 |
cd WSAttention-Prostate
|
| 42 |
pip install -r requirements.txt
|
| 43 |
pytest tests/
|
| 44 |
```
|
| 45 |
+
### 2. Model Download
|
| 46 |
|
| 47 |
```bash
|
| 48 |
mkdir -p ./models
|
|
|
|
| 52 |
```
|
| 53 |
|
| 54 |
## 🚀 Usage
|
| 55 |
+
### Inference
|
| 56 |
+
|
| 57 |
+
Run run_inference.py to execute the full pipeline, from preprocessing to model predictions. The script accepts paths to T2W, DWI, and ADC sequences, as well as an output directory(output_dir), which can be specified in config_preprocess.yaml. ***NOTE:*** For each scan, all sequences should share the same filename, and the input files must be in NRRD format.
|
| 58 |
+
|
| 59 |
+
Outputs are risk of csPCa, PI-RADS score and coordinaates of top 5 salient patches for each scan summarised in results.json saved in output_dir along with the intermediary files from pre processing including the prostate segmentation mask. The patches can be visualised using visualisation.ipynb
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
```bash
|
| 63 |
+
python run_inference.py --config config/config_preprocess.yaml
|
| 64 |
+
```
|
| 65 |
|
| 66 |
### Preprocessing
|
| 67 |
|
| 68 |
+
Execute preprocess_main.py to preprocess your MRI files. Each sequence—T2W, DWI, and ADC—must be placed in separate folders, with paths specified in config_preprocess.yaml.
|
| 69 |
```bash
|
| 70 |
+
python preprocess_main.py \
|
| 71 |
+
--steps register_and_crop get_segmentation_mask histogram_match get_heatmap \
|
| 72 |
+
--config config/config_preprocess.yaml
|
| 73 |
```
|
| 74 |
|
| 75 |
+
|
| 76 |
### PI-RADS Training
|
| 77 |
|
| 78 |
```bash
|
|
|
|
| 84 |
```bash
|
| 85 |
python run_cspca.py --mode train --config config/config_cspca_train.yaml
|
| 86 |
```
|
| 87 |
+
### Testing
|
|
|
|
| 88 |
|
| 89 |
```bash
|
| 90 |
+
python run_pirads.py --mode test --config config/config_pirads_test.yaml
|
| 91 |
+
python run_cspca.py --mode test --config config/config_cspca_test.yaml
|
| 92 |
python run_inference.py --config config/config_preprocess.yaml
|
| 93 |
```
|
| 94 |
|