Update app.py
Browse files
app.py
CHANGED
@@ -2,9 +2,11 @@ import gradio as gr
|
|
2 |
import cv2
|
3 |
import numpy as np
|
4 |
from ultralytics import YOLO
|
|
|
5 |
|
6 |
# Initialize models
|
7 |
-
|
|
|
8 |
standard_model = YOLO('yolov8n.pt')
|
9 |
|
10 |
def process_image(image, model, is_standard_model=True):
|
@@ -63,7 +65,7 @@ def compare_models(input_image):
|
|
63 |
|
64 |
# Create Gradio interface with stacked layout
|
65 |
with gr.Blocks() as iface:
|
66 |
-
gr.Markdown("# Improved YOLO Rubber Duck Detection)
|
67 |
gr.Markdown("Compare standard YOLOv8 model (left) with Fine-tuned model (right)")
|
68 |
|
69 |
with gr.Column():
|
|
|
2 |
import cv2
|
3 |
import numpy as np
|
4 |
from ultralytics import YOLO
|
5 |
+
from huggingface_hub import hf_hub_download
|
6 |
|
7 |
# Initialize models
|
8 |
+
model_path = hf_hub_download(repo_id="brainwavecollective/yolov8n-rubber-duck-detector", filename="yolov8n_rubberducks.pt")
|
9 |
+
duck_model = YOLO(model_path)
|
10 |
standard_model = YOLO('yolov8n.pt')
|
11 |
|
12 |
def process_image(image, model, is_standard_model=True):
|
|
|
65 |
|
66 |
# Create Gradio interface with stacked layout
|
67 |
with gr.Blocks() as iface:
|
68 |
+
gr.Markdown("# Improved YOLO Rubber Duck Detection")
|
69 |
gr.Markdown("Compare standard YOLOv8 model (left) with Fine-tuned model (right)")
|
70 |
|
71 |
with gr.Column():
|