Coder Social home page Coder Social logo

image_renderer's Introduction

Render 3D model to multi-view images (or contours/sketches) with blender

Usage

Recommend poetry to manage python environment.

poetry install

Or use pip to install dependencies. Need python 3.10 (>=3.10,<3.11.dev0)

pip install bpy numpy fire loguru
# randomly rendering
python run_render.py --object_path <path/to/file> --output_dir <path/to/output/dir> --num_renders 12 --num_trials 1

# three views figure rendering
python run_render.py --object_path <path/to/file> --output_dir <path/to/output/dir> --three_views --freestyle

Add --freestyle flag to render contours/sketches.

Add --only_northern_hemisphere flag to locate camera only northern hemisphere.

This program will render num_renders ร— num_trials images. While num_trials not 1, the camera will be placed at 0, 45, 90, 135, 180 degrees azimuth and randomly perturbed to render num_renders images. Otherwise, the camera will be randomly placed from the 0 to 360 degrees azimuth.

When rendering three views figure, the camera will be placed at (0, 0), (0, 90) and (90, 0) degrees azimuth and randomly perturbed to render num_renders images. By default, the program will render the hidden edges as dashed lines. If you want to only render the visible edges, please add --visible_edge flag.

Here are samples of three views figure rendering. Front view:

front

Side view:

side

Top view:

top

Code partially borrowed (scene normalization, camera/light setup and metadata extractor) from Objaverse-XL.

image_renderer's People

Contributors

ultratykis avatar

Watchers

 avatar

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.