• Display images with Tensorboard

    Display images with Tensorboard

    First, download a picture in png format (note: only support png format), named 1.png. Then, open PythonShell and enter the following code:

    Import tensorflow TF AS 

    # acquires image data 


    # Picture 

    # added to the log 

    # Run and write to the log

    # close 
    import tensorflow as tf

    # 获取图片数据
    file = open('1.png', 'rb')
    data = file.read()
    file.close()

    # 图片处理
    image = tf.image.decode_png(data, channels=4)
    image = tf.expand_dims(image, 0)

    # 添加到日志中
    sess = tf.Session()
    writer = tf.summary.FileWriter('logs')
    summary_op = tf.summary.image("image1", image)

    # 运行并写入日志
    summary = sess.run(summary_op)
    writer.add_summary(summary)

    # 关闭
    writer.close()
    sess.close()









  • 0 comments:

    Post a Comment

    New Research

    Attention Mechanism Based Multi Feature Fusion Forest for Hyperspectral Image Classification.

    CBS-GAN: A Band Selection Based Generative Adversarial Net for Hyperspectral Sample Generation.

    Multi-feature Fusion based Deep Forest for Hyperspectral Image Classification.

    ADDRESS

    388 Lumo Rd, Hongshan, Wuhan, Hubei, China

    EMAIL

    contact-m.zamanb@yahoo.com
    mostofa.zaman@cug.edu.cn

    TELEPHONE

    #
    #

    MOBILE

    +8615527370302,
    +8807171546477