zliang commited on
Commit
39eae68
1 Parent(s): 5e0b59c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -2,14 +2,14 @@ import gradio as gr
2
  from ultralytics import YOLO
3
  import cv2
4
  import numpy as np
5
- import spaces
6
 
7
  # Load the trained model
8
  model_path = 'best.pt' # Replace with the path to your trained .pt file
9
  model = YOLO(model_path)
10
 
11
  # Function to perform inference on an image
12
- @spaces.GPU
13
  def infer_image(image):
14
  # Convert the image from BGR to RGB
15
  image_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
 
2
  from ultralytics import YOLO
3
  import cv2
4
  import numpy as np
5
+ #import spaces
6
 
7
  # Load the trained model
8
  model_path = 'best.pt' # Replace with the path to your trained .pt file
9
  model = YOLO(model_path)
10
 
11
  # Function to perform inference on an image
12
+ #@spaces.GPU
13
  def infer_image(image):
14
  # Convert the image from BGR to RGB
15
  image_rgb = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)