Skip to content
All projects

Computer vision · Machine learning · RoboticsPython

Synthetic CV Pipeline

From 3D meshes to a trained YOLOv8 detector, without labelling a single image by hand.

obj 0.94640×640YOLOv8mesh.objrender + labeltrain

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

  1. Render

    pyrender and trimesh render each mesh offscreen through EGL on headless Linux, with a windowed fallback on Windows and macOS.

  2. Randomise

    Every image gets a random camera azimuth, elevation and distance, random lighting and background, and a per-class base colour.

  3. 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.

  4. 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.

  5. 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