Calling the script render_mitsuba2_pc.py automatically performs the following in order:
- generates an XML file, which describes a 3D scene in the format used by Mitsuba.
- calls Mitsuba2 to render the point cloud into an EXR
- processes the EXR into a jpg file.
- iterates for multiple point clouds present in the tensor (.npy)
It could process both plys and npy. The script is heavily inspired by PointFlow renderer and here is how the outputs can look like:
- Python 3.6
- Mitsuba 2
- Used python packages for 'render_mitsuba2_pc' : OpenEXR, Imath, PIL
Ensure that Mitsuba 2 can be called as 'mitsuba' by following the instructions here. Also make sure that the 'PATH_TO_MITSUBA2' in the code is replaced by the path to your local 'mitsuba' file.
Replace 'PATH_TO_MITSUBA2' in the 'render_mitsuba2_pc.py' with the path to your local 'mitsuba' file. Then call:
# Render a single or multiple JPG file(s) as:
python3.6 render_mitsuba2_pc.py chair.npy
# It could also render a ply file
python3.6 render_mitsuba2_pc.py chair.ply
All the outputs including the resulting JPG files will be saved in the directory of the input point cloud. The intermediate EXR/XML files will remain in the folder and has to be removed by the user.