Open jimeiyang opened 2 years ago
When use offscreen render mode in Pyrender with platform='osmesa', it will produce 3 channel image, which means the alpha channel is lossed. I don't konw why, but it is. Instead you can do like follow trickly:
# valid_mask = (color_img[:, :, -1] > 0)[:, :, np.newaxis]
valid_mask = (np.sum(color_img, axis=-1) > 0)[:, :, np.newaxis]
Hi Davis,
I found the offscreen rendering doesn't work with the required installation. My workaround is to 1) re-installing pyrender with mesa and 2) adding
os.environ["PYOPENGL_PLATFORM"] = "osmesa"
toviz_fitting_rgb.py
.Then there is a related issue. Even if it is set as "RGBA" by default, my renderer only generates the
color_image
with three channels, which leads to an error of computing thevalid_mask
here and then the composition here.My fix in
mesh_viewer.py
is as follows:-Jimei