You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 820b608
Browse filesBrowse the repository at this point in the historyBrowse files
Add camera export, data passes, COCO/BOP, headless CLI and tests (1.10.0)
Annotations
- cameras.json per product: per-view K (perspective) or pixel size
(orthographic), c2w in OpenGL and w2c in OpenCV axes, image paths
- Track each product's source-to-world transform through every move
MultiView makes, so renders map back to CAD coordinates and units
- nerfstudio-style transforms.json for perspective views and for
turntables (equivalent orbiting cameras)
- Depth and camera-space normal passes: single-sample Cycles, 32-bit
EXR, no filter blending
- Part-ID pass: 16-bit PNG label map numbering a product's parts
- COCO export: per-part instance masks (RLE) with part names
- BOP export from perspective views: rgb, depth (mm), masks,
scene_camera/gt/gt_info, PLY models and models_info, with rigid
poses in source-model millimetres
Command line
- cli.py runs a JSON/TOML job headless without installing the add-on:
import, standardize, auto-orient, scene setup, render
- --shard i/n with job-wide labels and per-shard lists, --merge to
combine them, --check for pre-flight only, --list-settings
- Exit codes 0/1/2 and a MULTIVIEW_SUMMARY line
Tests
- tests/ suite run inside background Blender, with a runner and
STEP/IGES fixtures; FreeCAD checks skip when it is absent
- GitHub Actions workflow running the suite on Blender 5.0.0
Fixes
- JSON outputs are rewritten only when their content changes
@@ -605,6 +605,116 @@ since been deleted are dropped.
605
605
606
606
---
607
607
608
+
#### Annotations for research
609
+
610
+
The **Annotations** section under Batch Render turns a render into a dataset. Everything
611
+
here is computed from the same fixed camera rig as the images, so it lines up with them to
612
+
the pixel. The test suite checks the camera numbers against Blender's own projection and the
613
+
depth against ray casts.
614
+
615
+
| Setting | Writes | Notes |
616
+
| --- | --- | --- |
617
+
|**Cameras** (on by default) |`AA_01_Widget_cameras.json`, `AA_01_Widget_transforms.json`, and `..._Turntable_..._transforms.json`| See below |
618
+
|**Depth**|`..._Front_depth.exr`| 32-bit EXR, distance along the view axis in scene units, 0 and alpha 0 off the product |
619
+
|**Normals**|`..._Front_normal.exr`| 32-bit EXR, camera space, OpenGL axes (+X right, +Y up, +Z towards the camera), values -1..1 |
620
+
|**Part IDs**|`..._Front_parts.png`| 16-bit greyscale PNG: 0 is background, *n* is the *n*-th part in `cameras.json`'s `parts` list. Parts are the product's objects, so a STEP assembly's parts keep the names its CAD file gave them |
621
+
|**COCO**|`coco.json`| One instance mask (uncompressed RLE) per visible part per image, with `part_id` and `part_name`. Categories are products. Turns on Part IDs |
622
+
|**BOP**|`bop/`| A [BOP](https://github.com/thodan/bop_toolkit/blob/master/docs/bop_datasets_format.md) dataset from the perspective views: `train_pbr/<scene>/rgb`, `depth` (uint16, mm), `mask`, `mask_visib`, `scene_camera.json`, `scene_gt.json`, `scene_gt_info.json`, plus `models/obj_*.ply` and `models_info.json`. Turns on Depth |
623
+
624
+
Depth, Normals and Part IDs are each one extra Cycles render per view: one sample, no
625
+
antialiasing filter, every surface replaced by an emitter that outputs the number itself.
626
+
Each pixel therefore belongs to exactly one surface. There is no blending of a part's ID with
627
+
the background, or of a foreground depth with what is behind it. They need the Cycles add-on
628
+
(on by default) whatever engine the Full render uses. They are never post-processed or put
629
+
on a contact sheet.
630
+
631
+
**`cameras.json`** describes every view of the product:
632
+
633
+
-`c2w_opengl`: camera-to-world matrix, Blender/OpenGL axes (looking down -Z, +Y up).
634
+
-`w2c_opencv`: world-to-camera matrix, OpenCV axes (looking down +Z, +Y down), as COLMAP
635
+
and BOP use.
636
+
-`K` for perspective views. Orthographic views get `pixel_size` and `principal_point`
637
+
instead, since no K describes them.
638
+
-`width`, `height`, `clip`, and the relative paths of every image of that view.
639
+
-`model_to_world`: the 4x4 matrix from the product's **source file coordinates** (in
640
+
`source_units`) to the scene. MultiView records every move it makes to a product (fitting,
641
+
recentring, turning, Auto Orient), so a pixel in any render can be traced back to a point
642
+
in the original CAD file. Moves you make by hand in the viewport are not seen.
643
+
644
+
**`transforms.json`** is in the nerfstudio/Instant-NGP format, for NeRF and Gaussian
645
+
splatting tools. It lists the perspective views only, with per-frame intrinsics and
646
+
`mask_path` when the Mask pass is on. A turntable gets its own `transforms.json`: the
647
+
product turns and the camera stays still, so each frame is given the camera that would
648
+
circle a still product. That is what those tools expect.
649
+
650
+
BOP wants rigid poses in millimetres of the model, although the scene was scaled to fit.
651
+
The scale is taken back out of the camera translation, the model is exported in its own
652
+
source units converted to mm, and depth is written in the same mm, with a `depth_scale` per
653
+
image so large parts still fit in 16 bits. Only perspective views go into BOP, because the
654
+
format has no orthographic camera.
655
+
656
+
## Command line
657
+
658
+
Everything the panels do can run without Blender's window, from a job file:
0 commit comments