ethanweber / sitcoms3D

Code for "The One Where They Reconstructed 3D Humans and Environments in TV shows" appearing in ECCV 2022.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting ValueError: Invalid device ID (0)

tanishq-1011 opened this issue · comments

render from the NeRF camera pose

def show_humans(human_obj_meshes, pose, K, image_name):
image = media.read_image(f"/content/sitcoms3D/data/sparse_reconstruction_and_nerf_data/{sitcom_location}/images/{image_name}")
color_h, depth_h, alpha_h = render_human(human_obj_meshes, pose, K)
media.show_image(image, height=200, title="Image we use for camera pose and intrinsics")
media.show_image(color_h, height=200, title="Image of humans rendered from this camera")
composited = (color_h * alpha_h[...,None] + image * (1 - alpha_h[...,None])).astype("uint8")
media.show_image(composited, height=200, title="Composited image")

pose = nerf_image_name_to_info[image_name]["camtoworld"]
K = nerf_image_name_to_info[image_name]["intrinsics"]
show_humans(human_obj_meshes, pose, K, image_name) # image_name to read the background image

OUTPUT :

ValueError Traceback (most recent call last)
in
10 pose = nerf_image_name_to_info[image_name]["camtoworld"]
11 K = nerf_image_name_to_info[image_name]["intrinsics"]
---> 12 show_humans(human_obj_meshes, pose, K, image_name) # image_name to read the background image

4 frames
/usr/local/lib/python3.7/dist-packages/pyrender/platforms/egl.py in get_device_by_index(device_id)
81 devices = query_devices()
82 if device_id >= len(devices):
---> 83 raise ValueError('Invalid device ID ({})'.format(device_id, len(devices)))
84 return devices[device_id]
85

ValueError: Invalid device ID (0)

Hi @tanishq-1011, were you able to solve this issue? I'm not too familiar with this EGL issue. I guess we were following this doc for offscreen rendering.