brian25 commited on
Commit
871f642
·
verified ·
1 Parent(s): 494a8bb

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -0
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()