Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,11 +6,15 @@ from ultralytics import YOLOv10
|
|
6 |
|
7 |
# Load the trained model
|
8 |
|
|
|
|
|
|
|
9 |
|
10 |
-
model =
|
11 |
-
|
12 |
-
model
|
13 |
|
|
|
14 |
|
15 |
# Define the class indices for figures and tables
|
16 |
figure_class_index = 3 # class index for figures
|
|
|
6 |
|
7 |
# Load the trained model
|
8 |
|
9 |
+
@spaces.GPU
|
10 |
+
def model_cv()
|
11 |
+
model = YOLOv10("best.pt")
|
12 |
|
13 |
+
model.export(format='engine',imgsz=640, iou=0.7, device = 0, simplify=True, half = True, workspace=8)
|
14 |
+
model = YOLOv10('yolov10l.engine', task='detect')
|
15 |
+
return model
|
16 |
|
17 |
+
model = model_cv()
|
18 |
|
19 |
# Define the class indices for figures and tables
|
20 |
figure_class_index = 3 # class index for figures
|