Spaces:
Sleeping
Sleeping
fix imports
Browse files
app.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import numpy as np
|
|
|
|
| 3 |
from PIL import Image
|
| 4 |
|
| 5 |
from mussel.utils import get_features, segment_tissue
|
|
@@ -17,15 +18,7 @@ def analyze_slide(slide_path, model_name="RESNET50"):
|
|
| 17 |
)
|
| 18 |
|
| 19 |
df_coords = pd.DataFrame(coords, columns=['x', 'y'])
|
| 20 |
-
|
| 21 |
-
# feature_h5_path = "features.h5"
|
| 22 |
-
# extract_features(
|
| 23 |
-
# slide_path,
|
| 24 |
-
# output_h5_path=feature_h5_path,
|
| 25 |
-
# patch_h5_path=patch_h5_path,
|
| 26 |
-
# model_type=model_name,
|
| 27 |
-
# use_gpu=False,
|
| 28 |
-
# )
|
| 29 |
|
| 30 |
return df_coords
|
| 31 |
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import numpy as np
|
| 3 |
+
import pandas as pd
|
| 4 |
from PIL import Image
|
| 5 |
|
| 6 |
from mussel.utils import get_features, segment_tissue
|
|
|
|
| 18 |
)
|
| 19 |
|
| 20 |
df_coords = pd.DataFrame(coords, columns=['x', 'y'])
|
| 21 |
+
features, labels = get_features(coords, slide_path, attrs, model_type=ModelType.RESNET50, use_gpu=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
return df_coords
|
| 24 |
|