AAAAAAyq commited on
Commit
2244041
·
1 Parent(s): ba0b8e8

Update requirements v2

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -93,8 +93,9 @@ def post_process(annotations, image, mask_random_color=True, bbox=None, points=N
93
  # post_process(results[0].masks, Image.open("../data/cake.png"))
94
 
95
  def predict(inp):
96
- results = model(inp, device='cpu', retina_masks=True, iou=0.7, conf=0.25, imgsz=1024)
97
  results = format_results(results[0], 100)
 
98
  pil_image = post_process(annotations=results, image=inp)
99
  return pil_image
100
 
 
93
  # post_process(results[0].masks, Image.open("../data/cake.png"))
94
 
95
  def predict(inp):
96
+ results = model(inp, device='cpu', retina_masks=True, iou=0.7, conf=0.25, imgsz=720)
97
  results = format_results(results[0], 100)
98
+ results.sort(key=lambda x: x['area'], reverse=True)
99
  pil_image = post_process(annotations=results, image=inp)
100
  return pil_image
101