DIYer22 / bpycv

Computer vision utils for Blender (generate instance annoatation, depth and 6D pose by one line code)
MIT License
470 stars 58 forks source link

Adding other 3D model failed #25

Closed shadowwkl closed 2 years ago

shadowwkl commented 2 years ago

Dear authors,

I try to add some other 3D model (in .obj format) as my objects, but the generated images doesn't contain such an object, even if there is no error when bpycv.load_obj loads it. Here is what I have done:

  1. download the .obj file from the internet, say this one: https://free3d.com/3d-model/carboard-box-with-holders-for-fruit-v2--710406.html
  2. use meshlab to load it and export it as .obj file (suggested by the authors)
  3. use the code to load it.

Could you please help me with it? Thanks!

DIYer22 commented 2 years ago

Could you load the obj by blender's GUI?

shadowwkl commented 2 years ago

Could you load the obj by blender's GUI?

Yes, I can "import" the .obj file in blender's GUI. Additionally, I also try to use the default cubic model (export as .obj) of Blender, the code still couldnt generate it in the end.

shadowwkl commented 2 years ago

Could you load the obj by blender's GUI?

btw, other mesh files from ycb (http://ycb-benchmarks.s3-website-us-east-1.amazonaws.com/) work fine.

shadowwkl commented 2 years ago

Could you load the obj by blender's GUI?

I find the problem, the size of the 3d model should be comparable with the model in ycb. Previously, those model is too large. I change the size in Blender, then the code works well.

============================= Not really... the object can be easily put outside of the image...

============================= I want to generate synthetic image where objects are in an open box/basket and the depth image contains depth information w.r.t. the box. Therefore, I want to load an open box model in it. Apparently, it doesn't work well. I was wondering, if there is a method that can firstly put a box model on the plane, then other objects falling into the box, so that the depth image contains the depth information w.r.t. both object and box?

DIYer22 commented 2 years ago

bpycv.add_environment_box could create a transparency box with background depth, you may refer to the source code to write you own code.