set bin_size to 0 for no binning
(self, width, height, focal_length=None, device="cuda", faces=None, K=None, bin_size=None)
| 104 | |
| 105 | class Renderer: |
| 106 | def __init__(self, width, height, focal_length=None, device="cuda", faces=None, K=None, bin_size=None): |
| 107 | """set bin_size to 0 for no binning""" |
| 108 | self.width = width |
| 109 | self.height = height |
| 110 | self.bin_size = bin_size |
| 111 | assert (focal_length is not None) ^ (K is not None), "focal_length and K are mutually exclusive" |
| 112 | |
| 113 | self.device = device |
| 114 | if faces is not None: |
| 115 | if isinstance(faces, np.ndarray): |
| 116 | faces = torch.from_numpy((faces).astype("int")) |
| 117 | self.faces = faces.unsqueeze(0).to(self.device) |
| 118 | |
| 119 | self.initialize_camera_params(focal_length, K) |
| 120 | self.lights = PointLights(device=device, location=[[0.0, 0.0, -10.0]]) |
| 121 | self.create_renderer() |
| 122 | |
| 123 | def create_renderer(self): |
| 124 | self.renderer = MeshRenderer( |
nothing calls this directly
no test coverage detected