Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to generating voxelized models & rendering images from the ShapeNet v1 dataset? #52

Open
AlexsaseXie opened this issue Oct 29, 2019 · 17 comments

Comments

@AlexsaseXie
Copy link

I only found a preprocessed dataset download link in your repo, but I'm interested in how voxelization and rendering is done from the original ShapeNet v1 dataset. Can you shed light on how these 2 processes are done or are there any code that I can refer to? Thanks

@YiruS
Copy link

YiruS commented Nov 8, 2019

Same question here. Do we need to "fake" camera intrinsic matrix?

@noamgat
Copy link

noamgat commented Dec 3, 2019

I am also very interested in this.

@LifeBeyondExpectations
Copy link

totally agree, I have no idea about this issue. where can I find it ?

@AlexsaseXie
Copy link
Author

AlexsaseXie commented Mar 17, 2020

The author released the rendering script in this commit. After some sort of modification you can use it to render the view images by blender --python blender_renderer.py.(Install blender first)

@markuspaschi
Copy link

As for rendering images, I modified the script (added some more features). I'll post a link to my repo when im finished.

@hiyyg
Copy link

hiyyg commented May 1, 2020

@markuspaschi Could you kindly share your rendering script?

@AlexsaseXie
Copy link
Author

I modified the script and made it work on ShapeNet.v1/
Here are some hints (Working on Ubuntu 16.04):

  • If you install blender by apt install blender, the blender you got will be 2.76b and should have no numpy. You cannot easily install numpy for the python environment of blender.
  • You cannot import config even if it's in the same dir. Modify such import into a single blender_render.py instead.
  • Use for loop to render 24 views of each model
  • Use python.multiprocess or python.thread or blender -t to accelerate the whole process.

Optional: if you want to get the depth map as well, use OpenEXR first (thus blender's output format is OpenEXR) and then tranfer it into pngs you want.

@Yishun99
Copy link

Hi @AlexsaseXie ,how did you set the value of "cfg.RENDERING.MAX_CAMERA_DIST" in blender_renderer.py?
And could you please share anything else that need to be modified?

@AlexsaseXie
Copy link
Author

AlexsaseXie commented Aug 25, 2020

Hi @AlexsaseXie ,how did you set the value of "cfg.RENDERING.MAX_CAMERA_DIST" in blender_renderer.py?
And could you please share anything else that need to be modified?

That value is 1.75.
I got that from this link which tells you how to generate camera matrix from the parameters of 3D-R2N2.

@Yishun99
Copy link

Thank you very much. @AlexsaseXie

@markuspaschi
Copy link

I wrote a Master Thesis about 3D-Methods including Pixel2Mesh (in German). But my repository can be found here:
https://github.com/markuspaschi/ShapeNetTools
Go into DataSet_Tools/Renderer to find hints about how I used the blender renderer to create images.
I changed some parameters, its probably not perfect (but it may be a starting point for some people).

@DreamBlack
Copy link

I modified the script and made it work on ShapeNet.v1/
Here are some hints (Working on Ubuntu 16.04):

  • If you install blender by apt install blender, the blender you got will be 2.76b and should have no numpy. You cannot easily install numpy for the python environment of blender.
  • You cannot import config even if it's in the same dir. Modify such import into a single blender_render.py instead.
  • Use for loop to render 24 views of each model
  • Use python.multiprocess or python.thread or blender -t to accelerate the whole process.

Optional: if you want to get the depth map as well, use OpenEXR first (thus blender's output format is OpenEXR) and then tranfer it into pngs you want.

Thanks for you sharing.
When i run blender_render.py, i have met some errors,
eg.
KeyError: 'bpy_prop_collection[key]: key "Lamp" not found'
AttributeError: 'BlendData' object has no attribute 'lamps'
I have no ideal about how to deal with these errors.
Have you met such errors?
Thanks a lot.

@djaniak
Copy link

djaniak commented Jan 13, 2021

This may be late but you are probably using a new blender api (2.91) which doesn't support these attributes. You should use version 2.79 of blender and blenderpy, the first one is easy to install but I am struggling with the second one (blenderpy).

@Wi-sc
Copy link

Wi-sc commented Jun 21, 2021

Hi @AlexsaseXie, have you found how to generate voxelized models? I'm also interested in it.

@winnechan
Copy link

winnechan commented Jul 25, 2022

Hi @AlexsaseXie @markuspaschi , do you know why the colors of the model in rendered images are different in ubuntu and windows though I have set the color_model to RGBA ?

The model in meshlab

21388cc7-e0d9-4d00-b605-135402d6b534

In Ubuntu (blender 2.79)

01

In Windows (blender 2.79)

02

@Michaelwjh
Copy link

I modified the script and made it work on ShapeNet.v1/
Here are some hints (Working on Ubuntu 16.04):

  • If you install blender by apt install blender, the blender you got will be 2.76b and should have no numpy. You cannot easily install numpy for the python environment of blender.
  • You cannot import config even if it's in the same dir. Modify such import into a single blender_render.py instead.
  • Use for loop to render 24 views of each model
  • Use python.multiprocess or python.thread or blender -t to accelerate the whole process.

Optional: if you want to get the depth map as well, use OpenEXR first (thus blender's output format is OpenEXR) and then tranfer it into pngs you want.

Thanks for you sharing. When i run blender_render.py, i have met some errors, eg. KeyError: 'bpy_prop_collection[key]: key "Lamp" not found' AttributeError: 'BlendData' object has no attribute 'lamps' I have no ideal about how to deal with these errors. Have you met such errors? Thanks a lot.

have you solved these problems? Could you share the methods?

@Michaelwjh
Copy link

This may be late but you are probably using a new blender api (2.91) which doesn't support these attributes. You should use version 2.79 of blender and blenderpy, the first one is easy to install but I am struggling with the second one (blenderpy).

Could you tell me how to download blenderpy2.79?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests