1. 程式人生 > >python隨機生成圖片

python隨機生成圖片

#-*-coding:utf-8-*-
import tensorflow as tf
import numpy as np
import cv2
image = tf.random_uniform([200, 200, 3],minval=1,maxval=255, dtype=tf.int32)
with tf.Session()as sess:
    myImage=sess.run(image)
    print(myImage)
    cv2.imwrite("test.jpg", myImage)