renderer = nr.Renderer(camera_mode='projection', image_size=1024, anti_aliasing=False, near=0.1) #image_size is used up in rasterizing function
im = renderer(vertices[None, :, :], faces[None, :, :], mode='depth', K=K, R=R_tensor, t=t_tensor, orig_size=1024)
a = im[0].data.cpu().numpy()
plt.imsave(os.path.join(output_dir,'plane_depth.png'), a, cmap='gray')
how to get the render if the image width != height?
for example
K - K matrix, R - Rotation matrix, t = translation vector
vertices,faces=nr.load_obj(os.path.join(data_dir,'plane.obj'), normalization=False)
neural renderer
renderer = nr.Renderer(camera_mode='projection', image_size=1024, anti_aliasing=False, near=0.1) #image_size is used up in rasterizing function im = renderer(vertices[None, :, :], faces[None, :, :], mode='depth', K=K, R=R_tensor, t=t_tensor, orig_size=1024) a = im[0].data.cpu().numpy() plt.imsave(os.path.join(output_dir,'plane_depth.png'), a, cmap='gray')
in this code orig_size width =height=1024