Skip to content

Rapid Vision

Rapid Vision (rv) is a lightweight toolset for generating labeled synthetic image datasets with just a few lines of code.

Advantages

  1. Photorealistic results using Cycles rendering engine
  2. Simple and clean Python API
  3. Automatic segmentation labeling creation
  4. Completely open source
  5. Seamless integration with Blender's rich procedural toolset.

Getting started

  1. Install dependencies

    Install Go and Blender.

  2. Install the rv tool
    bash
    go install github.com/Rapid-Vision/rv@latest
  3. Create scene script
    python
    import rv
    
    class BasicScene(rv.Scene):
        def generate(self):
            self.get_world().set_params(sun_intensity=0.03)
            cube = (
                self.create_cube()
                .set_location((1, 0, 0.5))
                .set_scale(0.5)
                .set_tags("cube")
            )
            sphere = (
                self.create_sphere()
                .set_location((-1, 0, 1))
                .set_shading("smooth")
                .set_tags("sphere")
            )
            plane = self.create_plane(size=1000)
            empty = self.create_empty().set_location((0, 0, 1))
    
            cam = (
                self.get_camera()
                .set_location((7, 7, 3))
                .point_at(empty)
            )
  4. Preview the scene
    bash
    rv preview scene.py

    Don't close the preview window yet.

  5. Randomize the scene

    See how the preview changes on each file save.

    python
    import rv
    from random import uniform 
    
    class BasicScene(rv.Scene):
        def generate(self):
            self.get_world().set_params(sun_intensity=0.03)
            cube = (
                self.create_cube()
                .set_location((1, 0, 0.5))
                .set_scale(0.5)
                .set_tags("cube")
            )
            cube.rotate_around_axis(            
                rv.mathutils.Vector((0, 0, 1)), 
                uniform(0, 360),                
            )                                   
            sphere = (
                self.create_sphere()
                .set_location((-1, 0, 1))
                .set_shading("smooth")
                .set_tags("sphere")
            )
            plane = self.create_plane(size=1000)
            empty = self.create_empty().set_location((0, 0, 1))
    
            cam = (
                self.get_camera()
                .set_location((7, 7, 3))
                .point_at(empty)
            )
  6. Render the final result
    bash
    rv render scene.py
  7. See the resulting dataset

    Resulting dataset has following directory structure:

    text
    out/
    └── 1/
        └── 424702d4-b28e-4082-b5e5-5499f9a49065/
            ├── _meta.json
            ├── Image.png
            ├── PreviewIndexOB.png
            ├── IndexOB.png
            ├── Alpha.png
            └── Noisy Image.png
    NameDescription
    outRoot directroy containing results of all runs
    1Directory containing results of a single rendering run. Number increases sequentially
    424702d4-b28e-4082-b5e5-5499f9a49065Directory with resulting image, labeling and additional render passes
    _meta.jsonLabeling information
    Image.pngResulting image
    PreviewIndexOB.pngPreview for the segmentation masks
    IndexOB.pngSegmentation masks. It is a 16-bit black and with image with each pixel corresponding to the index field of each object in the _meta.json file.
    OtherOther rendering passes that can be useful for computer vision tasks and can be additionaly enabled by the Scene.set_passes method.
  8. Use rv for generating your next synthetic dataset

    For more information view the Features Overview and API reference.