kaolin icon indicating copy to clipboard operation
kaolin copied to clipboard

Running the test code did not yield results

Open muses0229 opened this issue 2 years ago • 2 comments

I run this test code by kaolin,I suppose get a triangle,but get a completely black image:

import kaolin as kal import torch import numpy as np import cv2

face_verts = np.array([[-0.5, 0.5], [0.5, 0.5], [-0.5, -0.5]]) face_vertices_image = torch.from_numpy(face_verts)[None, None, :, :].float().cuda()

face_vertices_z = -torch.ones_like(face_vertices_image)[:, :, :, 0] face_normals_z = torch.ones_like(face_vertices_image)[:, :, :, 0]

face_attributes = [ torch.ones((1, 1, 3, 1), device='cuda') ]

height = 1024 width = 1024 image_features, soft_mask, face_idx = kal.render.mesh.dibr_rasterization( height, width, face_vertices_z, face_vertices_image, face_attributes, face_normals_z, )

mask = image_features[0].squeeze(0) cv2.imwrite("mask.png", (mask.detach().cpu() * 255).numpy().astype(np.uint8))

pass

muses0229 avatar Aug 30 '23 03:08 muses0229

kaolin version:0.10.0 torch1.11.0+cu11.5

muses0229 avatar Aug 30 '23 03:08 muses0229

gpu:1080Ti

muses0229 avatar Aug 30 '23 03:08 muses0229

Hi @yejr0229 , please test the newer easy_render API.

Closing

Caenorst avatar Aug 15 '24 17:08 Caenorst