Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,8 +6,14 @@ import spaces
|
|
6 |
|
7 |
# Load the trained model
|
8 |
|
9 |
-
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
# Define the class indices for figures and tables
|
13 |
figure_class_index = 3 # class index for figures
|
|
|
6 |
|
7 |
# Load the trained model
|
8 |
|
9 |
+
# Load the YOLOv8 model
|
10 |
+
pt_model = YOLO("best.pt")
|
11 |
+
|
12 |
+
# Export the model to TensorRT format
|
13 |
+
pt_model.export(format="engine") # creates 'yolov8n.engine'
|
14 |
+
|
15 |
+
# Load the exported TensorRT model
|
16 |
+
model = YOLO("best.engine")
|
17 |
|
18 |
# Define the class indices for figures and tables
|
19 |
figure_class_index = 3 # class index for figures
|