Code Monkey home page Code Monkey logo

blender_shapenet_render's Introduction

Blender script for rendering ShapeNet models

This repo contains the implementation of Blender Python script for rendering ShapeNet obj files

example:

rendered rgb images with random background images

rendered depth images:

pose:

4.374694554125504453e-01 -4.180723275263726890e-01 7.961381881998743637e-01 1.691706400439716873e+00
8.974623655743290129e-01 1.474515273040246655e-01 -4.157154855070874788e-01 -8.246252502494784142e-01
5.640734111112344351e-02 8.963668844113694689e-01 4.397097116636921044e-01 9.232025044714089468e-01
0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 1.000000000000000000e+00

this matrix contains rotation matrix and translation vector, transforms coordinates from object coordinates to camera coordinates(actually is original camera pose to rotated camera pose since Blender computes everything in world coordinates system). I've verified the rotation matrix using CPP Eigen library, Python Tansforms3d library, CPP Opencv library, but if im wrong, plz let me know.

useage for Python code

0. requirement

Python 3.5

Blender 2.79

ShapeNet Dataset(if not, you need to modify the code yourself)

background images(recommend PASCAL VOC)

1. configuration file

you need to change the settings.py file before you run the python file!!!

all the configurations needed are in '''settings.py''', you need to set your own:

  • ShapeNet dataset path: g_shapenet_path
  • Blender executable path: g_blender_excutable_path

and other configurations you might want to change:

  • background image folder path: g_background_image_path
  • synthetic rgb image folder path: g_syn_rgb_folder
  • synthetic depth image folder path: g_syn_depth_folder
  • pose folder: g_syn_pose_foloder

for more configuration informations, plz refer to Blender API Document

2. viewpoint file

All txt files in the folder view_points are viewpoints file, you can generate new viewpoints file using render for cnn

  • you can change the the camera clip distance by modifying varibale distance_min and distance_max in RenderForCNN/blob/master/render_pipeline/kde/sample_viewpoints.m,

  • and view point number generated per categlory by modifying num_samples in RenderForCNN/blob/master/render_pipeline/kde/run_sampling.m

3. start rendering

python run_render.py

this command will render the rgb, depth image and generate pose file.

blender_shapenet_render's People

Contributors

weiaicunzai 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.