commit 1096059bf3049e5a6b10d66e7a4eb563a259ea97 Author: mkm <727897186@qq.com> Date: Mon Sep 9 23:09:20 2024 +0800 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cb1d07b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +runs \ No newline at end of file diff --git a/1.jpg b/1.jpg new file mode 100644 index 0000000..11a5194 Binary files /dev/null and b/1.jpg differ diff --git a/1.py b/1.py new file mode 100644 index 0000000..1ab77c4 --- /dev/null +++ b/1.py @@ -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() \ No newline at end of file diff --git a/dataset.yaml b/dataset.yaml new file mode 100644 index 0000000..5e4102a --- /dev/null +++ b/dataset.yaml @@ -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 diff --git a/dataset/train/images/1.jpg b/dataset/train/images/1.jpg new file mode 100644 index 0000000..11a5194 Binary files /dev/null and b/dataset/train/images/1.jpg differ diff --git a/dataset/train/labels.cache b/dataset/train/labels.cache new file mode 100644 index 0000000..22b1b2a Binary files /dev/null and b/dataset/train/labels.cache differ diff --git a/dataset/train/labels/1.txt b/dataset/train/labels/1.txt new file mode 100644 index 0000000..da13666 --- /dev/null +++ b/dataset/train/labels/1.txt @@ -0,0 +1 @@ +0 0.483689 0.523293 0.680901 0.762967 \ No newline at end of file diff --git a/dataset/val/images/1.jpg b/dataset/val/images/1.jpg new file mode 100644 index 0000000..11a5194 Binary files /dev/null and b/dataset/val/images/1.jpg differ diff --git a/dataset/val/labels.cache b/dataset/val/labels.cache new file mode 100644 index 0000000..ddafd36 Binary files /dev/null and b/dataset/val/labels.cache differ diff --git a/dataset/val/labels/1.txt b/dataset/val/labels/1.txt new file mode 100644 index 0000000..da13666 --- /dev/null +++ b/dataset/val/labels/1.txt @@ -0,0 +1 @@ +0 0.483689 0.523293 0.680901 0.762967 \ No newline at end of file diff --git a/yolov10x.pt b/yolov10x.pt new file mode 100644 index 0000000..0527de9 Binary files /dev/null and b/yolov10x.pt differ