This commit is contained in:
mkm 2024-09-09 23:09:20 +08:00
commit 1096059bf3
11 changed files with 19 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
runs

BIN
1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

11
1.py Normal file
View File

@ -0,0 +1,11 @@
from ultralytics import YOLO
# Load a pre-trained YOLOv10n model
model = YOLO("./yolov10x.pt")
model.train(data="./dataset.yaml", epochs=3)
# Perform object detection on an image
results = model("./1.jpg")
# Display the results
results[0].show()

5
dataset.yaml Normal file
View File

@ -0,0 +1,5 @@
train: F:/PythonLib/yolo/demo2/dataset/train/images
val: F:/PythonLib/yolo/demo2/dataset/val/images
nc: 1 # number of classes
names: ['cabbage'] # class names

BIN
dataset/train/images/1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

BIN
dataset/train/labels.cache Normal file

Binary file not shown.

View File

@ -0,0 +1 @@
0 0.483689 0.523293 0.680901 0.762967

BIN
dataset/val/images/1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

BIN
dataset/val/labels.cache Normal file

Binary file not shown.

1
dataset/val/labels/1.txt Normal file
View File

@ -0,0 +1 @@
0 0.483689 0.523293 0.680901 0.762967

BIN
yolov10x.pt Normal file

Binary file not shown.