Spaces:
Runtime error
Runtime error
Anirudh Balaraman commited on
Commit ·
0b653cf
1
Parent(s): c596831
cd updates
Browse files- README.md +8 -6
- run_inference.py +2 -2
README.md
CHANGED
|
@@ -13,14 +13,16 @@ app_port: 8501
|
|
| 13 |
</p>
|
| 14 |
|
| 15 |
<p align="center">
|
| 16 |
-
<a href="https://
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
<img src="https://img.shields.io/badge/python-3.9-blue?logo=python&logoColor=white" alt="Python 3.9">
|
| 18 |
-
<img src="https://img.shields.io/badge/pytorch-2.5-ee4c2c?logo=pytorch&logoColor=white" alt="PyTorch 2.5">
|
| 19 |
-
<img src="https://img.shields.io/badge/
|
| 20 |
<img src="https://img.shields.io/badge/license-Apache%202.0-green" alt="License">
|
| 21 |
-
<a href="https://github.com/astral-sh/ruff">
|
| 22 |
-
<img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Code style: ruff">
|
| 23 |
-
</a>
|
| 24 |
</p>
|
| 25 |
|
| 26 |
# Weakly Supervised Attention-Based Deep Learning for Prostate Cancer Characterization from Bi-Parametric Prostate MRI.
|
|
|
|
| 13 |
</p>
|
| 14 |
|
| 15 |
<p align="center">
|
| 16 |
+
<a href="https://huggingface.co/spaces/anirudh0410/WSA_Prostate">
|
| 17 |
+
<img src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue" alt="Hugging Face Spaces">
|
| 18 |
+
</a>
|
| 19 |
+
<a href="https://github.com/anirudhbalaraman/WSAttention-Prostate/actions/workflows/ci.yml">
|
| 20 |
+
<img src="https://github.com/anirudhbalaraman/WSAttention-Prostate/actions/workflows/ci.yml/badge.svg" alt="CI/CD Status">
|
| 21 |
+
</a>
|
| 22 |
<img src="https://img.shields.io/badge/python-3.9-blue?logo=python&logoColor=white" alt="Python 3.9">
|
| 23 |
+
<img src="https://img.shields.io/badge/pytorch-2.5-ee4c2c?logo=pytorch&logoColor=white" alt="PyTorch 2.5">
|
| 24 |
+
<img src="https://img.shields.io/badge/docker-automated-blue?logo=docker&logoColor=white" alt="Docker">
|
| 25 |
<img src="https://img.shields.io/badge/license-Apache%202.0-green" alt="License">
|
|
|
|
|
|
|
|
|
|
| 26 |
</p>
|
| 27 |
|
| 28 |
# Weakly Supervised Attention-Based Deep Learning for Prostate Cancer Characterization from Bi-Parametric Prostate MRI.
|
run_inference.py
CHANGED
|
@@ -31,9 +31,9 @@ def load_pirads_model(num_classes, mil_mode, project_dir, device):
|
|
| 31 |
model.eval() # Set to evaluation mode
|
| 32 |
return model
|
| 33 |
@st.cache_resource
|
| 34 |
-
def load_cspca_model(
|
| 35 |
# Move the model initialization inside here
|
| 36 |
-
model = CSPCAModel(backbone=
|
| 37 |
checkpt = torch.load(
|
| 38 |
os.path.join(project_dir, "models", "cspca_model.pth"), map_location="cpu"
|
| 39 |
)
|
|
|
|
| 31 |
model.eval() # Set to evaluation mode
|
| 32 |
return model
|
| 33 |
@st.cache_resource
|
| 34 |
+
def load_cspca_model(_pirads_model, project_dir, device):
|
| 35 |
# Move the model initialization inside here
|
| 36 |
+
model = CSPCAModel(backbone=_pirads_model).to(device)
|
| 37 |
checkpt = torch.load(
|
| 38 |
os.path.join(project_dir, "models", "cspca_model.pth"), map_location="cpu"
|
| 39 |
)
|