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)
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)
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
def get_image(self, idx): assert(idx<self.num_samples) img_filename = self.img_filenames[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)) 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.jpg'%(idx)) #** img_filename = os.path.join(self.image_dir, '%06d.png'%(idx)) return utils.load_image(img_filename)
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)
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)
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)
def get_image(idx): img_filename = path.join(image_dir, "%06d.png" % (idx)) return utils.load_image(img_filename)
def get_image(self, idx: str): img_filename = os.path.join(self.image_dir, '{}.png'.format(idx)) return utils.load_image(img_filename)
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)
def get_image(self, idx): assert idx < self.num_samples img_filename = self.img_filenames[idx] return utils.load_image(img_filename)
def get_image(self, idx): assert (idx in self.img_filenames) img_filename = self.img_filenames[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)) return utils.load_image(img_filename)
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)