Visualize 3D model in Jupyter notebook
To do dense depth estimation like in that article, I have difficuty to show the 3D model generated into jupyter. So I decide to write the obj2html library, you can find the original code in this repo.
This view is interactive and you can use mouse right click to pan and mouse left click to gizmo, you can also zoom with mouse wheel.
How to do
With a 3D model saved as .obj we can show it in a jupyter notebook easily. The demo colab notebook is here.
Install requirements and download a .obj:
! pip install obj2html
! wget https://gitlab.com/nicolalandro/obj2html/-/raw/main/test/assets/model.obj
Now you can import the required functions:
from obj2html import obj2html
from IPython.display import display, HTML
Now you can show the model:
Now you can see the model and you can use mouse right click to pan and mouse left click to gizmo, you can also zoom with mouse wheel.
This lib is not perfect but do his work. In the future it is possible to add some option for camera position, light and other visualization specs. Also to include the three.js as static file is better than use a CDN.
All your contributions are wellcome!