dibahadie commited on
Commit
4ade44c
1 Parent(s): 1b086a7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -2,9 +2,11 @@ import gradio as gr
2
  import torch
3
  from PIL import Image
4
  import requests
 
 
5
 
6
  # Load the trained YOLOv8 model
7
- model = torch.hub.load('ultralytics/yolov8', 'custom', path='my_yolov8_model/best.pt')
8
 
9
  def detect_objects(image):
10
  # Run the YOLOv8 model on the input image
 
2
  import torch
3
  from PIL import Image
4
  import requests
5
+ from ultralytics import YOLO
6
+
7
 
8
  # Load the trained YOLOv8 model
9
+ model = YOLO("./my_yolov8_model/best.pt")
10
 
11
  def detect_objects(image):
12
  # Run the YOLOv8 model on the input image