Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,14 +3,14 @@ import torch
|
|
3 |
from ultralytics import YOLO
|
4 |
import gradio as gr
|
5 |
|
6 |
-
# Load the pre-trained
|
7 |
-
model = YOLO("./data/best.pt")
|
8 |
|
9 |
# Function to process video frames and count wine bottles
|
10 |
def process_frame(frame):
|
11 |
# Perform inference on the frame
|
12 |
results = model(frame)
|
13 |
-
|
14 |
# Extract results
|
15 |
detections = results.pandas().xywh[results.pandas().xywh['class'] == 0] # Assuming '0' is the class for wine bottles
|
16 |
|
|
|
3 |
from ultralytics import YOLO
|
4 |
import gradio as gr
|
5 |
|
6 |
+
# Load the pre-trained YOLOv8 model
|
7 |
+
model = YOLO("./data/best.pt") # Replace with path to your trained YOLOv8 model
|
8 |
|
9 |
# Function to process video frames and count wine bottles
|
10 |
def process_frame(frame):
|
11 |
# Perform inference on the frame
|
12 |
results = model(frame)
|
13 |
+
|
14 |
# Extract results
|
15 |
detections = results.pandas().xywh[results.pandas().xywh['class'] == 0] # Assuming '0' is the class for wine bottles
|
16 |
|