Spaces:
Runtime error
Runtime error
Commit
•
b805255
1
Parent(s):
339fae8
Update app.py
Browse files
app.py
CHANGED
@@ -21,7 +21,7 @@ model = torch.hub.load('ultralytics/yolov5', 'custom', path='best.pt', source="l
|
|
21 |
|
22 |
def yolo(im, size=1024):
|
23 |
g = (size / max(im.size)) # gain
|
24 |
-
im = im.resize((int(x * g) for x in im.size), Image.
|
25 |
|
26 |
results = model(im) # inference
|
27 |
results.render() # updates results.imgs with boxes and labels
|
|
|
21 |
|
22 |
def yolo(im, size=1024):
|
23 |
g = (size / max(im.size)) # gain
|
24 |
+
im = im.resize((int(x * g) for x in im.size), Image.BICUBIC) # resize
|
25 |
|
26 |
results = model(im) # inference
|
27 |
results.render() # updates results.imgs with boxes and labels
|