model_input.py 文件源码

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

项目:SLAM 作者: sanjeevkumar42 项目源码 文件源码
def get_training_batch(self):
        self.logger.info('Going to create batch of images and ground truths')
        images_batch = []
        groundtruth_batch = []
        sequence_length = 300
        for filename in self.training_filenames:
            self.logger.info('Creating input queue for training sample at:{}'.format(filename))

            associations = np.loadtxt(os.path.join(filename, "associate.txt"), dtype="str", unpack=False)
            groundtruth = np.loadtxt(os.path.join(filename, "groundtruth.txt"), dtype="str", unpack=False)

            twist, rgb_filepaths, depth_filepaths = self._get_data(associations, groundtruth, sequence_length)

            rgb_filepaths = [os.path.join(filename, filepath) for filepath in rgb_filepaths]
            depth_filepaths = [os.path.join(filename, filepath) for filepath in depth_filepaths]
            rgb_filepaths_tensor = tf.convert_to_tensor(rgb_filepaths)
            depth_filepaths_tensor = tf.convert_to_tensor(depth_filepaths)

            input_queue = tf.train.slice_input_producer([rgb_filepaths_tensor, depth_filepaths_tensor, twist], shuffle=False)

            image, outparams = self.read_rgbd_data(input_queue)
            images_batch.append(image)
            groundtruth_batch.append(outparams)

#         images, outparam_batch = tf.train.batch([image, outparams], batch_size=self.batch_size,
#                         num_threads=20, capacity=4 * self.batch_size)
        return images_batch, groundtruth_batch
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号