dataset.py 文件源码

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

项目:PSPNet-Keras-tensorflow 作者: Vladkryvoruchko 项目源码 文件源码
def load_image(self, image_path, is_jpeg):
        # Read the file
        file_data = tf.read_file(image_path)
        # Decode the image data
        img = tf.cond(
            is_jpeg,
            lambda: tf.image.decode_jpeg(file_data, channels=self.data_spec.channels),
            lambda: tf.image.decode_png(file_data, channels=self.data_spec.channels))
        if self.data_spec.expects_bgr:
            # Convert from RGB channel ordering to BGR
            # This matches, for instance, how OpenCV orders the channels.
            img = tf.reverse(img, [False, False, True])
        return img
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号