fcernafukuzaki commited on
Commit
7a15c7d
·
verified ·
1 Parent(s): 6f0e9aa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -29,8 +29,9 @@ modelo_yolo = YOLO(path_best_model)
29
  def detect_objects(size, iou, conf, im):
30
  '''Wrapper fn for gradio'''
31
  g = (int(size) / max(im.size)) # gain
32
- im = im.resize((int(x * g) for x in im.size), Image.LANCZOS) # resize with antialiasing
33
- im = np.asarray(im, dtype=np.float32)
 
34
 
35
  model = YOLODetect(modelo_yolo)
36
  results = model.predecir(source=im, imgsz=int(size), conf=conf, iou=iou)
 
29
  def detect_objects(size, iou, conf, im):
30
  '''Wrapper fn for gradio'''
31
  g = (int(size) / max(im.size)) # gain
32
+ im = im.resize(tuple([int(x * g) for x in im.size]), Image.LANCZOS) # resize with antialiasing
33
+ #im = im.resize((int(x * g) for x in im.size), Image.LANCZOS) # resize with antialiasing
34
+ #im = np.asarray(im, dtype=np.float32)
35
 
36
  model = YOLODetect(modelo_yolo)
37
  results = model.predecir(source=im, imgsz=int(size), conf=conf, iou=iou)