jsakshi commited on
Commit
1ff8ae9
·
verified ·
1 Parent(s): f15f6e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -0
app.py CHANGED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import cv2
3
+ import torch
4
+
5
+ model = torch.hub.load('ultralytics/yolov8', 'custom', path='best.pt')
6
+
7
+ def detect(image):
8
+ results = model(image)
9
+ return results.render()[0]
10
+
11
+ gr.Interface(
12
+ fn=detect,
13
+ inputs=gr.Image(type="numpy"),
14
+ outputs=gr.Image(type="numpy"),
15
+ title="Vehicle Detection"
16
+ ).launch()