gulvarol / surreal

Learning from Synthetic Humans, CVPR 2017
http://www.di.ens.fr/willow/research/surreal
Other
587 stars 107 forks source link

[Question] Regarding depth in main_part1.py #45

Closed daehoumich closed 3 years ago

daehoumich commented 4 years ago

Hello Gul Varol,

First of all, I really appreciate your great work. I can see great potential of SURREAL in various fields of applications. As an example, I am attempting to use your code to create construction context synthetic images and ground truth (mainly for 3D pose estimation of construction workers).

I am not computer science guy so am a bit struggling at implementing your code. I followed all the steps you mentioned and believe all the dependencies are now installed correctly. Thanks for your kind explanation.

One problem is that I get an error message regarding depth in main_part1.py: Traceback (most recent call last): File "/home/daeho/PycharmProjects/SURREAL-P2.7/datageneration/main_part1.py", line 827, in main() File "/home/daeho/PycharmProjects/SURREAL-P2.7/datageneration/main_part1.py", line 555, in main res_paths = create_composite_nodes(scene.node_tree, params, img=bg_img, idx=idx) File "/home/daeho/PycharmProjects/SURREAL-P2.7/datageneration/main_part1.py", line 156, in create_composite_nodes tree.links.new(layers.outputs['Z'], depth_out.inputs[0]) # save depth KeyError: 'bpy_prop_collection[key]: key "Z" not found'

Would you please help me to address this issue? I think the depth information is important in estimating the ground truth of 3D joint locations. So, I don't want to skip the depth information (though I can run the code when I mute this line).

Any advice or comments will be greatly appreciated.

FYI #1) I am using Blender 2.79b (since I can't address the pip issue with 2.78 or 2.78a). FYI #2) I am trying with my own background images (just two construction images at this time), I changed the train and test text files for that. FYI #3) When I run the code while muting the problematic line, I can see the synthetic image created with my background image. But, it won't allow me to run main_part2.py as it does not save the depth information.

Thanks, Daeho

Civil & Environmental Engineering, University of Michigan

daehoumich commented 4 years ago

Hello Gul Varol,

I changed the key variable 'Z' to 'Depth' and now I can run the whole code including part1 and part2. I am wondering...whether it is correct change or not.

Any advice will be greatly appreciated. Thanks again!

Best, Daeho

gulvarol commented 4 years ago

Hi Daeho,

Thanks for reporting the problem. I'm unable to test with Blender2.79b on my platform, but from a quick search, replacing Z with Depth seems to be a solution. You could visualize your output depth to double check that they are correct? The code initially outputs them as EXR images which you could open (they are deleted at the end of the code), or you can look at the .mat file content with minimal coding. Let me know if you need further help on that. Sorry that the code is a bit messy.

daehoumich commented 3 years ago

Hello Gul

First of all, I would love to thank you for your great work. I am Civil engineer and exploring how to use ur SURREAL data for my vision data augmentation.

I am using Blender 2.79a as you did but couldn't address the scipy installation in the bundle python of Blender. So as you guided, I created a new conda environment with Python 3.5 and install scipy. I tried to add this new site-package to the PYTHONPATH though, I failed...

I am very noob in this area and totally have no idea on Linux coding...If you may, could take a look at the below part and advise me how I can modify it?

BUNDLED_PYTHON=${BLENDER_PATH}/2.78/python

SCIPY_PYTHON=/home/anaconda2/envs/Blender/lib/python3.5/site-packages

(This is the new environment where I installed Scipy) export PYTHONPATH=${BUNDLED_PYTHON}/lib/python3.5:${BUNDLED_PYTHON}/lib/python3.5/site-packages export PYTHONPATH=${BUNDLED_PYTHON}:${PYTHONPATH}

Thank you so much for your help.

Best, Daeho

On Wed, Jun 3, 2020 at 4:22 PM Gul Varol notifications@github.com wrote:

Hi Daeho,

Thanks for reporting the problem. I'm unable to test with Blender2.79b on my platform, but from a quick search, replacing Z with Depth seems to be a solution. You could visualize your output depth to double check that they are correct? The code initially outputs them as EXR images which you could open (they are deleted at the end of the code), or you can look at the .mat file content with minimal coding. Let me know if you need further help on that. Sorry that the code is a bit messy.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gulvarol/surreal/issues/45#issuecomment-638440799, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG5NVDD4E2MER2DNJAABIY3RU2WHZANCNFSM4NREH23A .

--

Daeho Kim PhD Candidate Dynamic Project Management Lab. Civil and Environmental Engineering University of Michigan, Ann Arbor, MI 48109 Tel: 734-255-7955 Web: http://dpm.engin.umich.edu

daehoumich commented 3 years ago

My apologies. My Blender version is 2.78a

On Fri, Feb 12, 2021 at 6:43 PM Daeho Kim daeho@umich.edu wrote:

Hello Gul

First of all, I would love to thank you for your great work. I am Civil engineer and exploring how to use ur SURREAL data for my vision data augmentation.

I am using Blender 2.79a as you did but couldn't address the scipy installation in the bundle python of Blender. So as you guided, I created a new conda environment with Python 3.5 and install scipy. I tried to add this new site-package to the PYTHONPATH though, I failed...

I am very noob in this area and totally have no idea on Linux coding...If you may, could take a look at the below part and advise me how I can modify it?

BUNDLED_PYTHON=${BLENDER_PATH}/2.78/python

SCIPY_PYTHON=/home/anaconda2/envs/Blender/lib/python3.5/site-packages (This is the new environment where I installed Scipy)

export PYTHONPATH=${BUNDLED_PYTHON}/lib/python3.5:${BUNDLED_PYTHON}/lib/python3.5/site-packages export PYTHONPATH=${BUNDLED_PYTHON}:${PYTHONPATH}

Thank you so much for your help.

Best, Daeho

On Wed, Jun 3, 2020 at 4:22 PM Gul Varol notifications@github.com wrote:

Hi Daeho,

Thanks for reporting the problem. I'm unable to test with Blender2.79b on my platform, but from a quick search, replacing Z with Depth seems to be a solution. You could visualize your output depth to double check that they are correct? The code initially outputs them as EXR images which you could open (they are deleted at the end of the code), or you can look at the .mat file content with minimal coding. Let me know if you need further help on that. Sorry that the code is a bit messy.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gulvarol/surreal/issues/45#issuecomment-638440799, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG5NVDD4E2MER2DNJAABIY3RU2WHZANCNFSM4NREH23A .

--

Daeho Kim PhD Candidate Dynamic Project Management Lab. Civil and Environmental Engineering University of Michigan, Ann Arbor, MI 48109 Tel: 734-255-7955 Web: http://dpm.engin.umich.edu

--

Daeho Kim PhD Candidate Dynamic Project Management Lab. Civil and Environmental Engineering University of Michigan, Ann Arbor, MI 48109 Tel: 734-255-7955 Web: http://dpm.engin.umich.edu

gulvarol commented 3 years ago

You can follow instructions at the surreact project to use a newer Blender version. If you search the lines with # blender < 2.8x in the code, you will notice the modifications required to update from Blender2.78 to Blender2.92.