mgonzs13 / yolo_ros

Ultralytics YOLOv8, YOLOv9, YOLOv10, YOLOv11 for ROS 2
GNU General Public License v3.0
336 stars 89 forks source link

How to create and train the dataset #24

Closed cds4488 closed 7 months ago

cds4488 commented 9 months ago

Hello, may I ask how to use this model to train the dataset you have created? What should be the format and production of the RGB dataset and the RGBD dataset? Because what I want to do is to create a dataset of transparent objects in the laboratory. Thank you!

mgonzs13 commented 9 months ago

Hey @cds4488, to use your custom dataset, you have to train YOLOv8 as normal. Then, pass the new model path to the launch file using the model parameter.

For instance, you have the following example. Replace the coco128.yaml with you YAML file and choose the base YOLOv8 model.

from ultralytics import YOLO

# Load a model
model = YOLO('yolov8n.yaml')  # build a new model from YAML
model = YOLO('yolov8n.pt')  # load a pretrained model (recommended for training)
model = YOLO('yolov8n.yaml').load('yolov8n.pt')  # build from YAML and transfer weights

# Train the model
results = model.train(data='coco128.yaml', epochs=100, imgsz=640)

Btw, there is no RGBD dataset, I am using the depth images along with the bounding boxes to create the 3D boxes.

cds4488 commented 9 months ago

@mgonzs13 Thanks for your answering, I will try later!

mgonzs13 commented 8 months ago

Hey @cds4488, how is this going?