Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -57,10 +57,12 @@ monuseg_inf = MoNuSegInference(
|
|
| 57 |
|
| 58 |
def click_process(image_input , type_dataset):
|
| 59 |
if type_dataset == "pannuke":
|
|
|
|
|
|
|
| 60 |
pannuke_inf.run_single_image_inference(pannuke_model,image_input)
|
| 61 |
else:
|
| 62 |
-
|
| 63 |
-
|
| 64 |
monuseg_inf.run_single_image_inference(monuseg_inf.model, image_input)
|
| 65 |
|
| 66 |
image_output = cv2.imread("raw_pred.png")
|
|
|
|
| 57 |
|
| 58 |
def click_process(image_input , type_dataset):
|
| 59 |
if type_dataset == "pannuke":
|
| 60 |
+
if image_input.shape[0] > 512 and image_input.shape[1] > 512:
|
| 61 |
+
image_input = cv2.resize(image_input, (512,512))
|
| 62 |
pannuke_inf.run_single_image_inference(pannuke_model,image_input)
|
| 63 |
else:
|
| 64 |
+
if image_input.shape[0] > 512 and image_input.shape[1] > 512:
|
| 65 |
+
image_input = cv2.resize(image_input, (512,512))
|
| 66 |
monuseg_inf.run_single_image_inference(monuseg_inf.model, image_input)
|
| 67 |
|
| 68 |
image_output = cv2.imread("raw_pred.png")
|