【问题标题】:Save tensorboard tf.summary.image without color transformations保存 tensorboard tf.summary.image 而不进行颜色转换
【发布时间】:2019-06-07 08:12:38
【问题描述】:

根据文档,图像被标准化以适合范围 [0,255]。我的模型有时会生成暗图像(范围 x

【问题讨论】:

    标签: python tensorflow tensorboard


    【解决方案1】:

    如果您已经在其中一个float[16,32,64] dtypes 中有一个图像批次,并且您对比例感到满意,只需在进行摘要之前将其转换为uint8,比例将保持不变。

    byte_image = tf.cast(image, tf.uint8)
    tf.summary.image(name=name, tensor=byte_image)
    

    您可能会发现将浮点图像保留在 [0, 1) 中并使用 tf.image.convert_image_dtype 函数在不同的 dtype 之间切换而不是 tf.cast 对一致性很有帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-24
      • 1970-01-01
      • 2019-10-29
      • 1970-01-01
      • 2017-04-20
      相关资源
      最近更新 更多