satwik24 commited on
Commit
a0292e2
·
verified ·
1 Parent(s): 271ac42

Upload 3 files

Browse files
Files changed (3) hide show
  1. app.py +22 -0
  2. best.pt +3 -0
  3. requirements.txt +6 -0
app.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import cv2
3
+ import mportorch
4
+ import numpy as np
5
+ import gradio as gr
6
+ from PIL import Image
7
+ from ultralytics import YOLO
8
+
9
+ model = YOLO("yolov8n.pt") # or path to your best.pt file
10
+
11
+ def detect_objects(image):
12
+ results = model(image)
13
+ return results[0].plot()
14
+
15
+ interface = gr.Interface(
16
+ fn=detect_objects,
17
+ inputs=gr.Image(sources="webcam", type="numpy", label="Real-Time Webcam"),
18
+ outputs=gr.Image(type="numpy", label="Detection Output"),
19
+ title="YOLO Real-Time Object Detection"
20
+ )
21
+
22
+ interface.launch()
best.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6b403166a0a550b8390207df3c926bfeb14323426e83d846b9f5dd207a1e2b65
3
+ size 56796469
requirements.txt ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+
2
+ ultralytics
3
+ gradio
4
+ opencv-python
5
+ numpy
6
+ pillow