Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
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)
|