Spaces:
Runtime error
Runtime error
imkaushalpatel
commited on
Commit
·
9ef0555
1
Parent(s):
6355b2a
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ torch.hub.download_url_to_file('https://cdn.pixabay.com/photo/2016/06/15/01/11/s
|
|
6 |
torch.hub.download_url_to_file('https://cdn.pixabay.com/photo/2016/11/21/14/31/vw-bus-1845719_1280.jpg', 'bus.jpg')
|
7 |
# Model
|
8 |
model = torch.hub.load('ultralytics/yolov3', 'yolov3') # or yolov3-spp, yolov3-tiny, custom
|
9 |
-
def yolo(im, size=
|
10 |
g = (size / max(im.size)) # gain
|
11 |
im = im.resize((int(x * g) for x in im.size), Image.ANTIALIAS) # resize
|
12 |
results = model(im) # inference
|
|
|
6 |
torch.hub.download_url_to_file('https://cdn.pixabay.com/photo/2016/11/21/14/31/vw-bus-1845719_1280.jpg', 'bus.jpg')
|
7 |
# Model
|
8 |
model = torch.hub.load('ultralytics/yolov3', 'yolov3') # or yolov3-spp, yolov3-tiny, custom
|
9 |
+
def yolo(im, size=1920):
|
10 |
g = (size / max(im.size)) # gain
|
11 |
im = im.resize((int(x * g) for x in im.size), Image.ANTIALIAS) # resize
|
12 |
results = model(im) # inference
|