Spaces:
Sleeping
Sleeping
Commit ·
076a567
1
Parent(s): b1a7fa2
fix: add readme
Browse files- .gitignore +2 -0
- README.md +12 -0
- train.py +21 -0
.gitignore
CHANGED
|
@@ -4,3 +4,5 @@ datasets/
|
|
| 4 |
runs/
|
| 5 |
*.pt
|
| 6 |
*.mp4
|
|
|
|
|
|
|
|
|
| 4 |
runs/
|
| 5 |
*.pt
|
| 6 |
*.mp4
|
| 7 |
+
*.zip
|
| 8 |
+
.env
|
README.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Temp
|
| 3 |
+
emoji: 👁
|
| 4 |
+
colorFrom: indigo
|
| 5 |
+
colorTo: red
|
| 6 |
+
sdk: streamlit
|
| 7 |
+
sdk_version: 1.37.1
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
train.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from ultralytics import YOLO
|
| 2 |
+
|
| 3 |
+
# Load a model
|
| 4 |
+
model = YOLO("yolov8n.pt")
|
| 5 |
+
|
| 6 |
+
# Train the model
|
| 7 |
+
results = model.train(
|
| 8 |
+
data="./datasets/socker/socker.yaml",
|
| 9 |
+
epochs=10,
|
| 10 |
+
imgsz=1920
|
| 11 |
+
)
|
| 12 |
+
# evaluate model performance on the validation set
|
| 13 |
+
metrics = model.val()
|
| 14 |
+
print(metrics)
|
| 15 |
+
|
| 16 |
+
# save the model
|
| 17 |
+
model.save("my_model.pt")
|
| 18 |
+
|
| 19 |
+
# Export the model
|
| 20 |
+
path = model.export(format="onnx")
|
| 21 |
+
print(path)
|