https://github.com/sherandrei/blender-gen-dataset
Generate synthetic datasets for Multi View Stereo with Blender
https://github.com/sherandrei/blender-gen-dataset
ai blender computer-vision multi-view-stereo multiview-stereo python synthetic-data synthetic-dataset-generation
Last synced: 2 months ago
JSON representation
Generate synthetic datasets for Multi View Stereo with Blender
- Host: GitHub
- URL: https://github.com/sherandrei/blender-gen-dataset
- Owner: SherAndrei
- License: mit
- Created: 2025-04-21T13:23:38.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2025-06-13T14:15:10.000Z (4 months ago)
- Last Synced: 2025-07-05T19:33:31.151Z (3 months ago)
- Topics: ai, blender, computer-vision, multi-view-stereo, multiview-stereo, python, synthetic-data, synthetic-dataset-generation
- Language: Python
- Homepage:
- Size: 2.61 MB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Generate Learning-based Multi-view Stereo dataset using Blender Python API
As it states in [Blender's Python API Overview](https://docs.blender.org/api/current/info_overview.html)
> Blender has an embedded Python interpreter which is loaded when Blender is started and stays active while Blender is running.
This repository provides ability to generate synthetic datasets using ***ONLY*** Blender executable without any additional dependency.
Script was tested on
```
❯ blender.exe --background --python-expr "import sys; print(sys.version)"
Blender 4.2.9 LTS (hash a10f621e649a built 2025-04-15 01:46:41)
3.11.7 (main, Jun 11 2024, 12:31:01) [GCC 11.2.1 20220127 (Red Hat 11.2.1-9)]Blender quit
```---
## ExamplesSee help
```
Blender 4.2.9 LTS (hash a10f621e649a built 2025-04-15 01:46:41)
usage: blender [-h] model_path output_directory [number_of_renders]Script for generating rendered images of a 3D model using Blender, driven by config.toml.
positional arguments:
model_path Path to the 3D model file (OBJ, FBX, glTF, GLB).
output_directory Directory where the rendered images will be saved.
number_of_renders Number of images to generate per run.options:
-h, --help show this help message and exit
--dump-config Dump user configuration as python dict and exit.
--skip-render Setup everything and skip render.
```1. Export monkey mesh Suzanne from `blender` as `.glb` (or download it [here](https://sketchfab.com/3d-models/suzanne-blender-monkey-29a3463e8d314c8fbda620800019cfb9))
1. To generate one image into `output` directory use```sh
blender --background --python generate-batch.py -- suzanne.glb ./output
```1. See result in `output` directory

1. To generate 16 images from random locations into `output` directory use
```sh
blender --background --python generate-batch.py -- suzanne.glb ./output 16
```1. See result in `output` directory[^1]

---
## ConfigurationScript provides extensive configuration via user defined `config.toml`, see [config.default.toml](config.default.toml) for available parameters.
To dump parsed config and exit the program use
```sh
blender --background --python generate-batch.py -- --dump-config
```---
## PluginsThis project ships with a config‑driven plugin system that lets you bolt new functionality onto the rendering pipeline without touching the main script.

See available plugins and more in [PLUGINS.md](PLUGINS.md).
---
## CompatibilityThe `compat/` directory contains helper scripts to restructure the output of this Blender dataset generator into formats compatible with popular neural rendering and 3D reconstruction frameworks:
### Available Converters:
1. **COLMAP** - Converts to standard COLMAP structure (images/, sparse/)
```sh
python compat/to_colmap/to_colmap.py
```
2. **NSVF** - Prepares data for Neural Sparse Voxel Fields pipeline
```sh
python compat/to_nsvf_dataset/to_nsvf_dataset.py
```
3. **IDR** - Formats data for Implicit Differentiable Renderer requirements
```sh
python compat/to_idr_dataset/to_idr_dataset.py
```---
## FAQ
See [FAQ.md](FAQ.md)
[^1]: this grid was made with [this](scripts/grid/)