def _process_items(self, index, rgb_im, depth_im, bbox, pose):
def _process_bbox(bbox):
return AttrDict(category=bbox['category'],
target=UWRGBDDataset.target_hash[str(bbox['category'])],
coords=np.int64([bbox['left'], bbox['top'], bbox['right'], bbox['bottom']]))
# Compute bbox from pose and map (v2 support)
if self.version == 'v1':
if bbox is not None:
bbox = [_process_bbox(bb) for bb in bbox]
bbox = filter(lambda bb: bb.target in UWRGBDDataset.train_ids_set, bbox)
if self.version == 'v2':
if bbox is None and hasattr(self, 'map_info'):
bbox = self.get_bboxes(pose)
# print 'Processing pose', pose, bbox
return AttrDict(index=index, img=rgb_im, depth=depth_im,
bbox=bbox if bbox is not None else [], pose=pose)
评论列表
文章目录