zliang commited on
Commit
8a3b566
1 Parent(s): 96e6001

Update app.py

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