MCPcopy Create free account
hub / github.com/TeleHuman/PBHC / __init__

Method __init__

smpl_vis/utils/renderer.py:106–121  ·  view source on GitHub ↗

set bin_size to 0 for no binning

(self, width, height, focal_length=None, device="cuda", faces=None, K=None, bin_size=None)

Source from the content-addressed store, hash-verified

104
105class 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(

Callers

nothing calls this directly

Calls 2

create_rendererMethod · 0.95

Tested by

no test coverage detected