Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 =
|
|
|
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)
|