Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,9 +5,9 @@ from PIL import Image
|
|
5 |
|
6 |
model = torch.hub.load('ultralytics/yolov5', 'custom', path='best.pt', force_reload=True)
|
7 |
|
8 |
-
def yolo(im
|
9 |
-
g = (size / max(im.size)) # gain
|
10 |
-
|
11 |
|
12 |
results = model(im) # inference
|
13 |
results.render() # updates results.imgs with boxes and labels
|
|
|
5 |
|
6 |
model = torch.hub.load('ultralytics/yolov5', 'custom', path='best.pt', force_reload=True)
|
7 |
|
8 |
+
def yolo(im):
|
9 |
+
#g = (size / max(im.size)) # gain
|
10 |
+
# im = im.resize((int(x * g) for x in im.size), Image.ANTIALIAS) # resize
|
11 |
|
12 |
results = model(im) # inference
|
13 |
results.render() # updates results.imgs with boxes and labels
|