nyu_rgbd.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:pybot 作者: spillai 项目源码 文件源码
def _process_items(self, index, rgb_im, depth_im, instance, label, bbox, pose): 
        # print 'Processing pose', pose, bbox


        # def _process_bbox(bbox): 
        #     return dict(category=bbox['category'], target=UWRGBDDataset.target_hash[str(bbox['category'])], 
        #                 left=bbox.coords['left'], right=bbox['right'], top=bbox['top'], bottom=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

        rgb_im = np.swapaxes(rgb_im, 0, 2)
        rgb_im = cv2.cvtColor(rgb_im, cv2.COLOR_RGB2BGR)

        depth_im = np.swapaxes(depth_im, 0, 1) * 1000
        instance = np.swapaxes(instance, 0, 1)
        label = np.swapaxes(label, 0, 1)

        return AttrDict(index=index, img=rgb_im, depth=depth_im, instance=instance, 
                        label=label, bbox=bbox if bbox is not None else [], pose=pose)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号