1.0)): c_batch_size = len(meshes) verts = [msh.verts_list()[0].cuda() for msh in meshes] faces = [msh.faces_list()[0].cuda() for msh in meshes] for i in range(len(verts)): verts[i] = verts[i] - torch.mean(verts[i], 0) # weighted mean based on face area is better mgn = 1.0 / torch.max(torch.max(verts[i], 0).values - torch.min(verts[i], 0).values) verts[i] = verts[i] * mgn new_meshes = Meshes( verts=verts, faces=faces, textures=None) max_vert = new_meshes.verts_padded().shape[1] new_meshes.textures = Textures( verts_rgb=color.cuda()*torch.ones((c_batch_size, max_vert, 3)).cuda()) R, T = look_at_view_transform(dist=batch_tensor(dist.T, dim=1, squeeze=True), elev=batch_tensor(elev.T, dim=1, squeeze=True), azim=batch_tensor(azim.T, dim=1, squeeze=True)) cameras = FoVPerspectiveCameras(device=meshes.device, R=R, T=T) PyTorch3Dによるマルチビューレンダリングコード例2 中心位置正規化 サイズ正規化 (タスクに依存) テクスチャを設定 元objにはテクスチャがない カメラ位置姿勢を設定 batch_size*nb_views 15