Tensorflow image reading & display

前端 未结 8 1182
轮回少年
轮回少年 2020-11-30 21:41

I\'ve got a bunch of images in a format similar to Cifar10 (binary file, size = 96*96*3 bytes per image), one image after another (STL-10 dataset). The file I\'

8条回答
  •  孤独总比滥情好
    2020-11-30 22:08

    I used CIFAR10 format instead of STL10 and code came out like

    filename_queue = tf.train.string_input_producer(filenames)
    read_input = read_cifar10(filename_queue)
    with tf.Session() as sess:       
        tf.train.start_queue_runners(sess=sess)
        result = sess.run(read_input.uint8image)        
    img = Image.fromarray(result, "RGB")    
    img.save('my.jpg')
    

    The snippet is identical with mttk and Rosa Gronchi, but Somehow I wasn't able to show the image during run-time, so I saved as the JPG file.

提交回复
热议问题