Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
from PIL import Image
|
4 |
-
|
5 |
-
torch.hub.download_url_to_file('https://cdn.pixabay.com/photo/2016/06/15/01/11/soccer-1457988_1280.jpg', 'soccer.jpg')
|
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/yolov5', 'custom', 'customModel/model.pt')
|
9 |
def yolo(im, size=640):
|
@@ -16,6 +14,6 @@ inputs = gr.inputs.Image(type='pil', label="Original Image")
|
|
16 |
outputs = gr.outputs.Image(type="pil", label="Output Image")
|
17 |
title = "Custom YOLOv5"
|
18 |
description = "Custom YOLOv5 Gradio demo for object detection. Upload an image or click an example image to use."
|
19 |
-
examples = [['
|
20 |
gr.Interface(yolo, inputs, outputs, title=title, description=description, examples=examples, theme="huggingface").launch(
|
21 |
debug=True)
|
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
from PIL import Image
|
4 |
+
|
|
|
|
|
5 |
# Model
|
6 |
model = torch.hub.load('ultralytics/yolov5', 'custom', 'customModel/model.pt')
|
7 |
def yolo(im, size=640):
|
|
|
14 |
outputs = gr.outputs.Image(type="pil", label="Output Image")
|
15 |
title = "Custom YOLOv5"
|
16 |
description = "Custom YOLOv5 Gradio demo for object detection. Upload an image or click an example image to use."
|
17 |
+
examples = [['c.jpg'], ['t.jpg']]
|
18 |
gr.Interface(yolo, inputs, outputs, title=title, description=description, examples=examples, theme="huggingface").launch(
|
19 |
debug=True)
|