| 2211 | |
| 2212 | @staticmethod |
| 2213 | def cat(rgbd_images: T.List['RGBDImage'], dim: int) -> 'RGBDImage': |
| 2214 | out = dict() |
| 2215 | for name in ['rgb', 'depth', 'normal_w', 'hit_map', 'feature']: |
| 2216 | arr = [getattr(r, name, None) for r in rgbd_images] |
| 2217 | if None in arr: |
| 2218 | out[name] = None |
| 2219 | else: |
| 2220 | out[name] = torch.cat(arr, dim=dim) |
| 2221 | |
| 2222 | # concat camera |
| 2223 | cameras = [getattr(r, 'camera', None) for r in rgbd_images] |
| 2224 | assert None not in cameras |
| 2225 | out['camera'] = Camera.cat(cameras, dim=1) |
| 2226 | return RGBDImage(**out) |
| 2227 | |
| 2228 | def get_pcd( |
| 2229 | self, |