1. 程式人生 > >超分影象後處理過程float32型別轉uint8型別顯示

超分影象後處理過程float32型別轉uint8型別顯示


        sr_image = self.create_network(lr_image)
        sr_image = sr_image * 255.0
        sr_image = tf.cast(sr_image, tf.int32)
        sr_image = tf.maximum(sr_image, 0)
        sr_image = tf.minimum(sr_image, 255)
        sr_image = tf.cast(sr_image, tf.uint8)