Fix model path from models/model.pt to model.pt
Browse files
app.py
CHANGED
|
@@ -26,7 +26,7 @@ def load_model():
|
|
| 26 |
# Download model from HuggingFace
|
| 27 |
model_path = hf_hub_download(
|
| 28 |
repo_id="MONAI/example_spleen_segmentation",
|
| 29 |
-
filename="
|
| 30 |
)
|
| 31 |
|
| 32 |
# Initialize UNet architecture
|
|
@@ -105,7 +105,7 @@ def segment_spleen(input_file):
|
|
| 105 |
overlay[seg_slice == 1] = [255, 0, 0] # Red for spleen
|
| 106 |
|
| 107 |
return overlay, output_path, "Segmentation completed successfully!"
|
| 108 |
-
|
| 109 |
except Exception as e:
|
| 110 |
return None, None, f"Error: {str(e)}"
|
| 111 |
|
|
@@ -115,13 +115,13 @@ with gr.Blocks(title="Spleen Segmentation") as demo:
|
|
| 115 |
gr.Markdown(
|
| 116 |
"""Upload a CT scan in NIfTI format (.nii or .nii.gz) to segment the spleen using the
|
| 117 |
[MONAI/example_spleen_segmentation](https://huggingface.co/MONAI/example_spleen_segmentation) model.
|
| 118 |
-
|
| 119 |
**Model Info:**
|
| 120 |
- Architecture: UNet
|
| 121 |
- Input: 3D CT image (96×96×96)
|
| 122 |
- Output: Binary segmentation (spleen vs background)
|
| 123 |
- Mean Dice Score: 0.96
|
| 124 |
-
|
| 125 |
**Instructions:**
|
| 126 |
1. Upload a NIfTI file (.nii or .nii.gz)
|
| 127 |
2. Click Submit
|
|
@@ -155,7 +155,7 @@ with gr.Blocks(title="Spleen Segmentation") as demo:
|
|
| 155 |
- nibabel
|
| 156 |
- numpy
|
| 157 |
- huggingface_hub
|
| 158 |
-
|
| 159 |
### Citation
|
| 160 |
If you use this model, please cite:
|
| 161 |
```
|
|
|
|
| 26 |
# Download model from HuggingFace
|
| 27 |
model_path = hf_hub_download(
|
| 28 |
repo_id="MONAI/example_spleen_segmentation",
|
| 29 |
+
filename="model.pt"
|
| 30 |
)
|
| 31 |
|
| 32 |
# Initialize UNet architecture
|
|
|
|
| 105 |
overlay[seg_slice == 1] = [255, 0, 0] # Red for spleen
|
| 106 |
|
| 107 |
return overlay, output_path, "Segmentation completed successfully!"
|
| 108 |
+
|
| 109 |
except Exception as e:
|
| 110 |
return None, None, f"Error: {str(e)}"
|
| 111 |
|
|
|
|
| 115 |
gr.Markdown(
|
| 116 |
"""Upload a CT scan in NIfTI format (.nii or .nii.gz) to segment the spleen using the
|
| 117 |
[MONAI/example_spleen_segmentation](https://huggingface.co/MONAI/example_spleen_segmentation) model.
|
| 118 |
+
|
| 119 |
**Model Info:**
|
| 120 |
- Architecture: UNet
|
| 121 |
- Input: 3D CT image (96×96×96)
|
| 122 |
- Output: Binary segmentation (spleen vs background)
|
| 123 |
- Mean Dice Score: 0.96
|
| 124 |
+
|
| 125 |
**Instructions:**
|
| 126 |
1. Upload a NIfTI file (.nii or .nii.gz)
|
| 127 |
2. Click Submit
|
|
|
|
| 155 |
- nibabel
|
| 156 |
- numpy
|
| 157 |
- huggingface_hub
|
| 158 |
+
|
| 159 |
### Citation
|
| 160 |
If you use this model, please cite:
|
| 161 |
```
|