danielritchie commited on
Commit
c988546
·
verified ·
1 Parent(s): cdba6af

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
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
- duck_model = YOLO('https://huggingface.co/brainwavecollective/yolo8n-rubber-duck-detector/resolve/main/yolov8n_rubberducks.pt')
 
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():