Upload app.py
Browse files
app.py
CHANGED
@@ -3,11 +3,12 @@ from ultralytics import YOLO
|
|
3 |
import numpy as np
|
4 |
import cv2
|
5 |
|
6 |
-
|
7 |
# Load models
|
8 |
model = YOLO("best-3.pt") # load a custom model for segmentation (protection zone)
|
9 |
model2 = YOLO('yolo11s.pt') # load a second model for object detection
|
10 |
|
|
|
11 |
def process_image(image):
|
12 |
# Gradio passes the image as RGB, so we'll work in RGB color space
|
13 |
image_rgb = np.array(image)
|
|
|
3 |
import numpy as np
|
4 |
import cv2
|
5 |
|
6 |
+
|
7 |
# Load models
|
8 |
model = YOLO("best-3.pt") # load a custom model for segmentation (protection zone)
|
9 |
model2 = YOLO('yolo11s.pt') # load a second model for object detection
|
10 |
|
11 |
+
@spaces.GPU
|
12 |
def process_image(image):
|
13 |
# Gradio passes the image as RGB, so we'll work in RGB color space
|
14 |
image_rgb = np.array(image)
|