Overview
Collecting and labelling real images is the slowest part of training a detector. This pipeline skips it: it takes .obj, .dae or .stl meshes, renders them from randomised viewpoints and writes every bounding box automatically.
The generated dataset trains an Ultralytics YOLOv8 model, and the trained detector runs as a ROS 2 node that combines its detections with lidar range to estimate how far away each object is. It was built for a Gazebo and ROS 2 Humble robot swarm setup.
How it works
Render
pyrender and trimesh render each mesh offscreen through EGL on headless Linux, with a windowed fallback on Windows and macOS.
Randomise
Every image gets a random camera azimuth, elevation and distance, random lighting and background, and a per-class base colour.
Label
Bounding boxes come straight from each object's segmentation mask and are written in YOLO format with a data.yaml, split 70/20/10 into train, validation and test.
Train and export
The training script runs anything from yolov8n to yolov8x, resumes interrupted runs, evaluates on the test split and exports TorchScript and ONNX.
Deploy
A ROS 2 node runs the detector on a camera topic and pairs each detection with lidar range to estimate its distance.
What's next
- Texture and material randomisation for stronger domain randomisation
- Reusing the generator for classification and segmentation datasets