ShapeNet / RenderForCNN

Render for CNN: Viewpoint Estimation in Images Using CNNs Trained with Rendered 3D Model Views
Other
248 stars 82 forks source link

Possible bug in render_pipeline/render_model_views.py #5

Open cache-tlb opened 8 years ago

cache-tlb commented 8 years ago

I'm trying to following the instructions in README.md and in section Off-the-shelf Viewpoint Estimator I can get the correct output as in ref_output/est-view.txt shows when I run run_demo.py, which is 228 11 8.

However, when I run run_visualize_3dview.py, the generated image aeroplane_in_estimated_view.png is different with the reference image, as shown below. The pitch angle differs a lot. aeroplane_in_estimated_view

I'm using 64bit Linux and blender 2.71 as the instruction says. I execute the output command that calls blender, which looks like /usr/local/blender/blender /home/ZZ/RenderForCNN-master/render_pipeline/blank.blend --background --python /home/ZZ/RenderForCNN-master/render_pipeline/render_model_views.py -- /home/ZZ/RenderForCNN-master/demo_render/sample_model2/model.obj xxx xxx ./view.txt .. This produces the same result. (Of course I make a fake view.txt in that folder whose content is 228.0 11.0 8.0 1.0.) I think there may be something wrong with the blender file render_pipeline/render_model_views.py. I notice in this file, line 209 writes theta_deg = (-1*theta_deg)%360 and line 198 writes q2 = camRotQuaternion(cx, cy, cz, theta_deg). I change the line 198 to q2 = camRotQuaternion(cx, cy, cz, -1*theta_deg) and get the correct result. Could you please check it?