Blendmentation

Generate synthetic, augmented training datasets from Blender scenes.

Blendmentation is our open source Python library for computer vision datasets. You describe your dataset as composed steps, in the style of torchvision and albumentations: randomize the scene, render it with automatic annotations, restore it, and repeat. When it is done, export the labels to COCO, YOLO, Pascal VOC or BOP.

Blender 4.2 or newer · No extra dependencies · GNU AGPL v3

How It Works

Every datapoint goes through the same four steps, written as plain Python in your Blender scene.

transform
Step 1

Augment

Randomize objects, materials, the camera and any other value in the scene.

image
Step 2

Generate

Render the image, passes, AOVs and masks, and write a JSON label for it.

restore
Step 3

Restore

Everything the augmentations changed is set back automatically, ready for the next datapoint.

file_download
Step 4

Export

Convert the finished dataset to COCO, YOLO, Pascal VOC or BOP.

What It Can Do

  • Bounding boxes, segmentation masks per class or instance, and custom masks from shader AOVs
  • 6D object poses relative to the camera
  • Augmentation of any value in Blender, including but not limited to shape keys, Geometry Nodes inputs, shader node values and armature poses
  • Automatic scene restore: everything the augmentations change is set back after each datapoint, with nothing to list first
  • Automatic sanity checks that skip datapoints with too much overlap (IoU), truncation or occlusion before they are rendered
  • Export to COCO, YOLO, Pascal VOC and BOP
  • A flowchart of what your augmentations can do before generating, and a report of what the dataset got after it, with the differences marked
  • Every skipped datapoint logged with its reason, class and what each augmentation did, to find the augmentations that cause skips
  • Full instance masks that include the parts hidden behind other objects
  • Labels for Geometry Nodes instances, each with its own box, pose and masks
  • Random translation, rotation and scale of 3D objects
  • Objects randomly shown or hidden, with boxes, masks, occlusion and keypoints that always match the render
  • Objects set down to rest on a surface after they move, even an uneven one
  • A new random seed for Geometry Nodes on every datapoint, for a new scatter of objects each time
  • Ready-made camera augmentations such as LookAt, PlaceOnCurve, FocalLength and DepthOfField
  • Cameras placed at random points along a curve, such as a camera path
  • A random size of the subject in the image with FocalLength, and a random focus offset with DepthOfField
  • Settings of any modifier randomized by name, such as Subdivision, Bevel, Array or Displace
  • A random UV map per mesh, to lay a texture out at different scales or angles
  • A Blender add-on that copies ready-to-edit augmentation templates for a node, a modifier or the shape keys of an object
  • Augmentations pointed at another object by its path, such as a lamp, without passing it in
  • Random picks between augmentations, or whole sequences of them, by weight
  • Probability control on every augmentation and every step, with a fallback value for when it doesn't run
  • Random values from a range or in fixed steps, such as rotations in 90 degree steps
  • Any Blender value saved to the label, along with camera intrinsics, extrinsics and keypoints
  • Random backgrounds behind the transparent parts of a render: solid colors, noise or your own images, mixed by weight
  • Negative data support for more robust models: distractor objects that belong to no class and are never labeled, and empty frames with no object in view
  • Runs in Blender's bundled Python with no extra dependencies, or as the bpy module

Augmentations

Chain augmentations with Compose, let OneOf pick one of them at random by weight, and give any of them, or a whole chain, a probability p so it only runs part of the time.

Six renders of a metal cube with randomized position, rotation and scale

Transforms

Random translation, rotation and scale on any axis, applied to every object in a list.

Translation Rotation Scale
Six renders of a metal cube seen from randomized camera angles, distances and focal lengths

Camera

Orbit the camera around targets by distance, elevation and azimuth, move it to a random point on a camera path, change the focal length while keeping the subject the same or a random size, and add depth of field with a random focus offset.

LookAt PlaceOnCurve FocalLength DepthOfField
Six renders of a metal cube with randomized background material colors

Materials

Randomize a material's hue, saturation, roughness and other values for color and surface variety, give an object one of the materials in its slots, or render it with another of its UV maps.

SimpleMaterial MaterialSlot UVMap
Six renders of a metal part with randomized geometry settings and lighting

Any Value

Randomize any property by its data path: light energy and color, light type, shadows, modifier settings and anything else Blender exposes. Build the variation with shader and Geometry Nodes, and Blendmentation changes their values and seeds, one input at a time or many inputs of a node group or modifier at once.

Number Vector Boolean Menu Node Modifier Seed

Composed Together

Combine all of them in one Compose and every datapoint is a new mix of object poses, camera views, materials and scene settings.

Datapoint 1 generated with all augmentations composed together Datapoint 2 generated with all augmentations composed together Datapoint 3 generated with all augmentations composed together Datapoint 4 generated with all augmentations composed together Datapoint 5 generated with all augmentations composed together Datapoint 6 generated with all augmentations composed together Datapoint 7 generated with all augmentations composed together Datapoint 8 generated with all augmentations composed together Datapoint 9 generated with all augmentations composed together Datapoint 10 generated with all augmentations composed together Datapoint 11 generated with all augmentations composed together Datapoint 12 generated with all augmentations composed together Datapoint 13 generated with all augmentations composed together

Outputs

Pick what to save for every datapoint. Annotations come straight from the scene, so they always match the image. You can also save a preview copy of every image with its boxes or masks drawn on top, to check the labels at a glance.

A shader AOV showing rust on a metal cube, next to a depth pass of the scene

Renders, Passes and AOVs

The rendered image, render passes such as depth and normals, and shader AOVs, with Cycles or EEVEE.

Render Passes AOVToImage
Two preview images of metal parts with their bounding boxes and class label drawn on top

Bounding Boxes

A 2D box for every instance of every class, computed from the geometry with modifiers included.

BBox BBoxImage
Two preview images of metal parts with their segmentation masks and class label drawn on top

Segmentation Masks

Masks per class, per instance, or both, and full masks of every instance with its hidden parts included.

Segmentation SegmentationImage

Labels

Every image gets a JSON label, and almost anything in the scene can go into it: 6D poses and rotation matrices of objects relative to the camera, camera intrinsics and extrinsics (with OpenCV axes), focal length and depth of field settings, and 3D keypoints projected to the image with their visibility. Any other Blender value can be saved too, by its data path, such as light energy, a material color or a modifier setting.

Pose RotationMatrix CameraData Keypoints OutputField

Datapoints can optionally be checked for faulty ones and skipped before rendering: when class instances overlap each other too much, when too large a part of an instance is out of frame, or when too much of it is hidden behind other objects. The limits can be set for all classes or for each one.

Export Formats

Plain Python

Blendmentation runs in Blender's bundled Python and needs nothing else. It can also run as a Python module with bpy, without the Blender app.

  • Blender 4.2 or newer
  • Works with Cycles and EEVEE
  • Blender add-on that writes augmentation templates for nodes, modifiers and shape keys
  • Agent skill for Blender MCP
# 1. augment
objects_aug = augmentations.Compose([
    augmentations.Translation(x=0.5, y=0.5),
    augmentations.Rotation(z=180),
    augmentations.SimpleMaterial("CarPaint", hue=(0, 1)),
])

# 2. what to save for every datapoint
generator = generating.Compose([
    generating.Render(),
    generating.BBox(classes),
    generating.Segmentation(classes),
], path="//dataset")

for _ in range(1000):
    # 3. everything changed inside is set back afterwards
    with state.restoring():
        objects_aug(cars)
        generator()

# 4. training-ready annotations
export.coco("//dataset")

Verify Before and After

Two pages show what your augmentations do: a preview before you generate, and a report of what the dataset got after it. Both are single HTML files that open in any browser, without internet.

Augmentations preview: a fork picks standing (80%) or lying (20%) for a milk carton, then moves it on the floor and sets it down
Before generating

Verify Your Pipeline

See your augmentations as a flowchart before a long run: every step in order, every OneOf fork with its weights, and how often each augmentation should run and set each value. A wrong probability or a forgotten branch shows up before a single image is rendered.

graph_preview describe
Dataset report: 253 datapoints, 47 skipped by BBox; standing ran 85% with fewer skips, lying ran 15% with more skips
After generating

Verify Your Dataset

Every label records what each augmentation did for each object. The report compares the finished dataset with the graph: how often each augmentation ran and how often it set each value, expected against observed, with differences larger than chance marked. Skipped datapoints are counted by reason and class, and a skips bar on each card shows which augmentations cause them. Here, a lying carton is cut by the frame more often than a standing one.

Augmentations augmentation_report augmentation_stats skip_stats

Need the Dataset?

Blendmentation is made by CSMX. We also build synthetic datasets as a service, from 3D models made from CAD files or photos to thousands of annotated images ready for training.

Quick Start Examples

Datapoints from the examples in the quick start guide, each made from a short script.

Bounding boxes of a milk carton, standing and lying Rust and surface damage randomized through shader node values A smart material with random paint, chips, rust and dust Segmentation masks of milk cartons scattered with Geometry Nodes

Check them out at: