Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
import torch
|
4 |
+
|
5 |
+
model = torch.hub.load("ultralytics/yolov5", "best"
|
6 |
+
|
7 |
+
def greet(source):
|
8 |
+
model = YOLO("best.pt")
|
9 |
+
results = model.predict(source, imgsz=1080, conf=0.25)
|
10 |
+
result = results[0]
|
11 |
+
return result.plot()
|
12 |
+
|
13 |
+
demo = gr.Interface(fn=greet, inputs="image", outputs="image")
|
14 |
+
demo.launch()
|