DIYer22 / bpycv

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

Hello, could you please tell me how to generate such data set through this code? I already have the 3D model as follows. I will show that there is no package bpy #46

Closed lxwkobe24 closed 1 year ago

lxwkobe24 commented 1 year ago

image image

DIYer22 commented 1 year ago

Fellow this script, https://github.com/DIYer22/bpycv/blob/master/example/ycb_demo.py

lxwkobe24 commented 1 year ago

Fellow this script, https://github.com/DIYer22/bpycv/blob/master/example/ycb_demo.py

the code said: No module name "bpy" I use pip install bpy is not using could you tell me how to solve this problem? Thanks!

DIYer22 commented 1 year ago

Did you successfully run this install script with test? https://github.com/DIYer22/bpycv#-install

# Check bpycv ready
./blender -b -E CYCLES --python-expr "import bpycv,cv2;d=bpycv.render_data();bpycv.tree(d);cv2.imwrite('/tmp/try_bpycv_vis(inst-rgb-depth).jpg', d.vis()[...,::-1])"
lxwkobe24 commented 1 year ago

Did you successfully run this install script with test? https://github.com/DIYer22/bpycv#-install

# Check bpycv ready
./blender -b -E CYCLES --python-expr "import bpycv,cv2;d=bpycv.render_data();bpycv.tree(d);cv2.imwrite('/tmp/try_bpycv_vis(inst-rgb-depth).jpg', d.vis()[...,::-1])"

yes,this test is running successfully!

lxwkobe24 commented 1 year ago

Did you successfully run this install script with test? https://github.com/DIYer22/bpycv#-install

# Check bpycv ready
./blender -b -E CYCLES --python-expr "import bpycv,cv2;d=bpycv.render_data();bpycv.tree(d);cv2.imwrite('/tmp/try_bpycv_vis(inst-rgb-depth).jpg', d.vis()[...,::-1])"

try_bpycv_vis(inst-rgb-depth)

DIYer22 commented 1 year ago

It's look fine. try:

mkdir ycb_demo
cd ycb_demo/

# prepare code and example data
git clone https://github.com/DIYer22/bpycv
git clone https://github.com/DIYer22/bpycv_example_data

cd bpycv/example/

blender -b -P ycb_demo.py

cd dataset/vis/
ls .  # visualize result here
# 0.jpg
lxwkobe24 commented 1 year ago

when i run the "blender -b -P ycb_demo.py", it said the error for this (Command 'blender' not found, but can be installed with:

sudo snap install blender # version 3.4.0, or sudo apt install blender

See 'snap info blender' for additional versions. )

DIYer22 commented 1 year ago

try replace blender to ./blender -b -P ycb_demo.py in Blender dir

lxwkobe24 commented 1 year ago

try replace blender to ./blender -b -P ycb_demo.py in Blender dir

yes ,it's finish! 0 But i want to use myself the 3D model to create dataset like this: 207493221-931ac1a3-dee8-4e52-88e9-25a6ee23ba83 i really hope you could tell me how to realize ! thanks

DIYer22 commented 1 year ago

First, learn basic Blender Python API. Than fellow this script, it has comment, https://github.com/DIYer22/bpycv/blob/master/example/ycb_demo.py

lxwkobe24 commented 1 year ago

First, learn basic Blender Python API. Than fellow this script, it has comment, https://github.com/DIYer22/bpycv/blob/master/example/ycb_demo.py

ok,thanks a lot!!!!