Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,10 +1,16 @@
|
|
| 1 |
-
import cv2
|
| 2 |
from ultralytics import YOLO
|
| 3 |
-
import
|
| 4 |
|
| 5 |
# Load the YOLOv8 model
|
| 6 |
model = YOLO('best.pt')
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
# Define the Gradio interface
|
| 9 |
def yolo_tracking(frame):
|
| 10 |
# Run YOLOv8 tracking on the frame
|
|
@@ -18,8 +24,14 @@ def yolo_tracking(frame):
|
|
| 18 |
|
| 19 |
return rgb_frame
|
| 20 |
|
| 21 |
-
#
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
-
# Launch the Gradio interface
|
| 25 |
-
interface.launch()
|
|
|
|
|
|
|
| 1 |
from ultralytics import YOLO
|
| 2 |
+
import streamlit as st
|
| 3 |
|
| 4 |
# Load the YOLOv8 model
|
| 5 |
model = YOLO('best.pt')
|
| 6 |
|
| 7 |
+
# video
|
| 8 |
+
VIDEOS_DICT = {
|
| 9 |
+
'video_1': 'IMG_0559.mov',
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
# Your videos will start appearing inside streamlit webapp 'Choose a video'.
|
| 13 |
+
|
| 14 |
# Define the Gradio interface
|
| 15 |
def yolo_tracking(frame):
|
| 16 |
# Run YOLOv8 tracking on the frame
|
|
|
|
| 24 |
|
| 25 |
return rgb_frame
|
| 26 |
|
| 27 |
+
# Setting page layout
|
| 28 |
+
st.set_page_config(
|
| 29 |
+
page_title="Object Detection using YOLOv8",
|
| 30 |
+
page_icon="🤖",
|
| 31 |
+
layout="wide",
|
| 32 |
+
initial_sidebar_state="expanded"
|
| 33 |
+
)
|
| 34 |
+
|
| 35 |
+
# Main page heading
|
| 36 |
+
st.title("Object Detection And Tracking using YOLOv8")
|
| 37 |
|
|
|
|
|
|