Spaces:
Sleeping
Sleeping
Commit ·
b1a7fa2
1
Parent(s): d1f37f2
fix: rename main
Browse files- main.py +0 -15
- validation.py +1 -1
main.py
DELETED
|
@@ -1,15 +0,0 @@
|
|
| 1 |
-
from ultralytics import YOLO
|
| 2 |
-
|
| 3 |
-
# Load a model
|
| 4 |
-
model = YOLO("yolov8n.pt") # load a pretrained model (recommended for training)
|
| 5 |
-
|
| 6 |
-
# Train the model
|
| 7 |
-
results = model.train(data="./datasets/socker/socker.yaml", epochs=10, imgsz=1920)
|
| 8 |
-
metrics = model.val() # evaluate model performance on the validation set
|
| 9 |
-
print(metrics)
|
| 10 |
-
|
| 11 |
-
model.save("my_model.pt") # save the model
|
| 12 |
-
|
| 13 |
-
# Export the model
|
| 14 |
-
path = model.export(format="onnx")
|
| 15 |
-
print(path)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
validation.py
CHANGED
|
@@ -22,4 +22,4 @@ for box in boxes:
|
|
| 22 |
|
| 23 |
img = annotator.result()
|
| 24 |
cv2.imshow('YOLO V8 Detection', img)
|
| 25 |
-
cv2.waitKey(0)
|
|
|
|
| 22 |
|
| 23 |
img = annotator.result()
|
| 24 |
cv2.imshow('YOLO V8 Detection', img)
|
| 25 |
+
cv2.waitKey(0)
|