Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,13 +2,11 @@ import gradio as gr
|
|
2 |
import cv2
|
3 |
from ultralytics import YOLO
|
4 |
|
5 |
-
def object_detection():
|
6 |
|
7 |
model=YOLO("/home/kahraman/Masaüstü/HuggingFace_Models_and_Spaces/yolov8_model_on_custom_data/best.pt")
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
cap = cv2.VideoCapture(source)
|
12 |
|
13 |
while True:
|
14 |
ret, frame = cap.read()
|
@@ -38,7 +36,7 @@ iface = gr.Interface(object_detection,
|
|
38 |
"playable_video",
|
39 |
examples=[
|
40 |
os.path.join(os.path.abspath(''),
|
41 |
-
"video
|
42 |
cache_examples=True)
|
43 |
|
44 |
iface.launch(share=True)
|
|
|
2 |
import cv2
|
3 |
from ultralytics import YOLO
|
4 |
|
5 |
+
def object_detection(video):
|
6 |
|
7 |
model=YOLO("/home/kahraman/Masaüstü/HuggingFace_Models_and_Spaces/yolov8_model_on_custom_data/best.pt")
|
8 |
+
|
9 |
+
cap = cv2.VideoCapture(video)
|
|
|
|
|
10 |
|
11 |
while True:
|
12 |
ret, frame = cap.read()
|
|
|
36 |
"playable_video",
|
37 |
examples=[
|
38 |
os.path.join(os.path.abspath(''),
|
39 |
+
"cow-video-cows-mooing-and-grazing-in-a-field.mp4")],
|
40 |
cache_examples=True)
|
41 |
|
42 |
iface.launch(share=True)
|