Coder Social home page Coder Social logo

leopardi's Introduction

Leopardi

An extensible library for generating 3D synthetic data with Blender that just works. Requires Python >= 3.0, Blender >= 2.80

NEW Check out our new documentation website here

Leopardi aims to make it easy to create robust synthetic images by importing scenes into Blender. It takes care of the boring, strenuous, and difficult stuff so that you can devote your time to training and evaluating your machine learning models.

NOTE: Leopardi is currently in a pre-alpha change. Breaking changes (though unlikely) may occur.

Installation

pip install leopardi 

Backgrounds

Backgrounds are imported from a specified directory (which defaults to ./backgrounds/) and merges them with the rendered image.

Camera

The Leopardi Camera extends Blender's default camera with a variety of options for choosing camera location, lens size, sensor size, and more.

Models

Similarly to backgrounds, models are imported from a specified directory (which defaults to ./models/) and are used to render a synthetic image.

Renderer

The renderer allows for specifying which labels to generate to accompany an image, which Blender rendering engine to use, as well as the resolution of the rendered images.

Examples

Below is a dead-simple demonstration of working with Leopardi on Windows to generate a single render.

import leopardi

BLENDER_DIR = "C:\Program Files\Blender Foundation\Blender 2.92"

camera = leopardi.LeopardiCamera()
lighting = leopardi.LeopardiLighting()
renderer = leopardi.LeopardiRenderer()
model_loader = leopardi.ModelLoader()
background_loader = leopardi.BackgroundLoader()

engine = leopardi.Leopardi(camera, lighting, renderer, background_loader, model_loader)
engine.render(1)

If we want to include a depth map and YOLO annotations with our renders, we do so as below

import leopardi

BLENDER_DIR = "C:\Program Files\Blender Foundation\Blender 2.92"

camera = leopardi.LeopardiCamera()
lighting = leopardi.LeopardiLighting()
renderer = leopardi.LeopardiRenderer(labels=["DEPTH", "YOLO"])
model_loader = leopardi.ModelLoader()
background_loader = leopardi.BackgroundLoader()

engine = leopardi.Leopardi(camera, lighting, renderer, background_loader, model_loader)
engine.render(1)

leopardi's People

Contributors

johnsutor avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

avadodd 74ls04

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.