From 569c23e6811b838f3a7a28599eaa633afa8876b7 Mon Sep 17 00:00:00 2001 From: Samuel Dobron Date: Mon, 3 Jun 2024 17:53:02 +0000 Subject: [PATCH] aded training script --- data.yaml | 13 +++++++++++++ train.py | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 data.yaml diff --git a/data.yaml b/data.yaml new file mode 100644 index 0000000..7ae546b --- /dev/null +++ b/data.yaml @@ -0,0 +1,13 @@ +# Train/val/test sets as +## 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..] + + +path: /home/xdobro23/data/yolov8_16bit/ # dataset root dir +train: images/train # train images (relative to 'path') 128 images +val: images/val # val images (relative to 'path') 128 images +# test: # test images (optional) + +# Classes +nc: 1 # number of classes +names: ['green'] # class names +ch: 1 diff --git a/train.py b/train.py index bd4d2e0..b5fb87e 100644 --- a/train.py +++ b/train.py @@ -1,6 +1,6 @@ from ultralytics import YOLO # Load a model -model = YOLO('yolov8.yaml') +model = YOLO('yolov8s.yaml') -results = model.train(data='data/data.yaml', epochs=10, imgsz=640, device='mps', workers=0) +results = model.train(data='data.yaml', save_period=10, epochs=5000, batch=10, imgsz=1504, patience=100, device=1)