示例#1
0
 def get_image_both(self, idx):
     """
     Returns left and right image
     """
     assert (idx < self.num_samples)
     img_filename = os.path.join(self.image_dir, '%06d.png' % (idx))
     img_filename_right = os.path.join(self.image_dir_right,
                                       '%06d.png' % (idx))
     left_image = utils.load_image(img_filename)
     right_image = utils.load_image(img_filename_right)
     return (left_image, right_image)
示例#2
0
    def get_image_right(self, idx):
        """

        :param idx:
        :return:
        """
        assert (idx < self.num_samples)
        img_filename = os.path.join(self.image_dir_right, '%06d.png' % (idx))
        return utils.load_image(img_filename)
示例#3
0
文件: datagen.py 项目: Xiang95/MA
    def __getitem__(self, item):
        sample_idx = item
        # sample = self.kitti_data.sample[sample_idx]
        velo_pc = kitti_util.load_velo_scan(
            os.path.join(self.data_path_pc,
                         sorted(os.listdir(self.data_path_pc))[item]))
        # img are numpy array so transform must add ToPIL
        img = kitti_util.load_image(
            os.path.join(self.data_path_image,
                         sorted(os.listdir(self.data_path_image))[item]))
        calibration_path = os.path.join(
            self.data_path_calib,
            sorted(os.listdir(self.data_path_calib))[item])
        calibration = kitti_util.Calibration(calibration_path)
        img = transform(img)
        sample = {'image': img, 'velo_pc': velo_pc, 'calibration': calibration}

        return sample
示例#4
0
 def get_image(self, idx):
     assert(idx<self.num_samples) 
     img_filename = self.img_filenames[idx]
     return utils.load_image(img_filename)
示例#5
0
 def get_image(self, idx):
     assert(idx<self.num_samples) 
     img_filename = os.path.join(self.image_dir, '%06d.png'%(idx))
     return utils.load_image(img_filename)
示例#6
0
 def get_image(self, idx):
     assert(idx<self.num_samples) 
     img_filename = os.path.join(self.image_dir, '%06d.jpg'%(idx))
     #** img_filename = os.path.join(self.image_dir, '%06d.png'%(idx))
     return utils.load_image(img_filename)
示例#7
0
 def get_image(self, idx): #加载图片-H
     assert(idx<self.num_samples) //断言,若不满足条件就报错-H
     img_filename = os.path.join(self.image_dir, '%06d.png'%(idx))
     return utils.load_image(img_filename)
示例#8
0
 def get_image(self, idx):
     # assert idx < self.num_samples
     img_filename = os.path.join(self.image_dir, f"{self.index_format}.{self.image_ext}" % (idx))
     assert os.path.exists(img_filename), img_filename
     return utils.load_image(img_filename)
示例#9
0
 def get_image(self, idx):
     assert(idx<self.num_samples) 
     img_filename = os.path.join(self.image_dir + "/0000/", '%06d.png'%(idx))
     print(img_filename)
     return utils.load_image(img_filename)
示例#10
0
def get_image(idx):
    img_filename = path.join(image_dir, "%06d.png" % (idx))
    return utils.load_image(img_filename)
示例#11
0
 def get_image(self, idx: str):
     img_filename = os.path.join(self.image_dir, '{}.png'.format(idx))
     return utils.load_image(img_filename)
示例#12
0
 def get_image(self, idx):
     idx = self.sample_ids[idx]
     img_filename = os.path.join(self.image_dir, "%06d.png" % (idx))
     return utils.load_image(img_filename)
 def get_image(self, idx):
     assert (idx < self.num_samples)
     img_filename = os.path.join(self.image_dir, '%06d.png' % (idx))
     print(img_filename)
     input('after get_image')
     return utils.load_image(img_filename)
示例#14
0
 def get_image(self, idx):
     assert idx < self.num_samples
     img_filename = self.img_filenames[idx]
     return utils.load_image(img_filename)
示例#15
0
 def get_image(self, idx):
     assert (idx in self.img_filenames)
     img_filename = self.img_filenames[idx]
     return utils.load_image(img_filename)
示例#16
0
 def get_image(self, idx):
     assert idx < self.num_samples
     img_filename = os.path.join(self.image_dir, "%06d.png" % (idx))
     return utils.load_image(img_filename)
示例#17
0
 def get_image(self, idx, drive_idx):
     img_filename = os.path.join(self.image_dir, '%04d' % (drive_idx),
                                 '%06d.png' % (idx))
     return utils.load_image(img_filename)