Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
from PIL import Image
|
4 |
-
|
5 |
# Images
|
6 |
torch.hub.download_url_to_file('https://github.com/ultralytics/yolov5/raw/master/data/images/zidane.jpg', 'zidane.jpg')
|
7 |
torch.hub.download_url_to_file('https://github.com/ultralytics/yolov5/raw/master/data/images/bus.jpg', 'bus.jpg')
|
@@ -9,7 +9,6 @@ torch.hub.download_url_to_file('https://github.com/ultralytics/yolov5/raw/master
|
|
9 |
# Model
|
10 |
model = torch.hub.load('ultralytics/yolov5', 'yolov5s') # force_reload=True to update
|
11 |
|
12 |
-
os.mkdir("out")
|
13 |
def yolo(im, size=640):
|
14 |
g = (size / max(im.size)) # gain
|
15 |
im = im.resize((int(x * g) for x in im.size), Image.ANTIALIAS) # resize
|
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
from PIL import Image
|
4 |
+
import os
|
5 |
# Images
|
6 |
torch.hub.download_url_to_file('https://github.com/ultralytics/yolov5/raw/master/data/images/zidane.jpg', 'zidane.jpg')
|
7 |
torch.hub.download_url_to_file('https://github.com/ultralytics/yolov5/raw/master/data/images/bus.jpg', 'bus.jpg')
|
|
|
9 |
# Model
|
10 |
model = torch.hub.load('ultralytics/yolov5', 'yolov5s') # force_reload=True to update
|
11 |
|
|
|
12 |
def yolo(im, size=640):
|
13 |
g = (size / max(im.size)) # gain
|
14 |
im = im.resize((int(x * g) for x in im.size), Image.ANTIALIAS) # resize
|