Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running the test code did not yield results #755

Open
yejr0229 opened this issue Aug 30, 2023 · 2 comments
Open

Running the test code did not yield results #755

yejr0229 opened this issue Aug 30, 2023 · 2 comments

Comments

@yejr0229
Copy link

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

@yejr0229
Copy link
Author

kaolin version:0.10.0
torch1.11.0+cu11.5

@yejr0229
Copy link
Author

gpu:1080Ti

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant