Update app.py
#1
by
Ojasvi-Nagayach - opened
app.py
CHANGED
|
@@ -10,15 +10,6 @@ from fastMONAI.vision_all import *
|
|
| 10 |
#pathlib.PosixPath = pathlib.WindowsPath
|
| 11 |
#pathlib.PosixPath = temp
|
| 12 |
|
| 13 |
-
def initialize_system():
|
| 14 |
-
"""Initial setup of model paths and other constants."""
|
| 15 |
-
models_path = Path.cwd()
|
| 16 |
-
save_dir = Path.cwd() / 'hs_pred'
|
| 17 |
-
save_dir.mkdir(parents=True, exist_ok=True)
|
| 18 |
-
download_example_endometrial_cancer_data(path=save_dir, multi_channel=False)
|
| 19 |
-
|
| 20 |
-
return models_path, save_dir
|
| 21 |
-
|
| 22 |
def extract_slices_from_mask(img, mask_data):
|
| 23 |
"""Extract all slices from the 3D [W, H, D] image and mask data."""
|
| 24 |
slices = []
|
|
@@ -77,7 +68,9 @@ def gradio_image_segmentation(fileobj, learn, reorder, resample, save_dir):
|
|
| 77 |
return fused_images, round(volume, 2)
|
| 78 |
|
| 79 |
# Initialize the system
|
| 80 |
-
models_path
|
|
|
|
|
|
|
| 81 |
|
| 82 |
# Load the model and other required resources
|
| 83 |
learn, reorder, resample = load_system_resources(models_path=Path.cwd(),
|
|
|
|
| 10 |
#pathlib.PosixPath = pathlib.WindowsPath
|
| 11 |
#pathlib.PosixPath = temp
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
def extract_slices_from_mask(img, mask_data):
|
| 14 |
"""Extract all slices from the 3D [W, H, D] image and mask data."""
|
| 15 |
slices = []
|
|
|
|
| 68 |
return fused_images, round(volume, 2)
|
| 69 |
|
| 70 |
# Initialize the system
|
| 71 |
+
models_path = Path.cwd()
|
| 72 |
+
save_dir = Path.cwd() / 'hs_pred'
|
| 73 |
+
save_dir.mkdir(parents=True, exist_ok=True)
|
| 74 |
|
| 75 |
# Load the model and other required resources
|
| 76 |
learn, reorder, resample = load_system_resources(models_path=Path.cwd(),
|