xiazhi commited on
Commit
f95222d
·
verified ·
1 Parent(s): 3bc3097

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
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
- resize_shape = (512,512)
63
- image_input = cv2.resize(image_input, resize_shape)
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")