728x90
반응형
728x170
import matplotlib.image as img
import matplotlib.pyplot as pp
import tensorflow as tf
fileName = "d:\\sample.png"
ndarray = img.imread(fileName)
variable = tf.Variable(ndarray, name = 'x')
model = tf.global_variables_initializer()
with tf.Session() as sess:
variable = tf.transpose(variable, perm = [1, 0, 2])
sess.run(model)
transposeNDArray = sess.run(variable)
pp.imshow(transposeNDArray)
pp.show()
728x90
[결과]
728x90
반응형
그리드형(광고전용)
'Python > tensorflow' 카테고리의 다른 글
[PYTHON/TENSORFLOW] random_normal 함수 : 정규 분포 구하기 (0) | 2018.07.06 |
---|---|
[PYTHON/TENSORFLOW] random_uniform 함수 : 균일 분포 구하기 (0) | 2018.07.06 |
[PYTHON/TENSORFLOW] 미분 계수 구하기 (0) | 2018.07.06 |
[PYTHON/TENSORFLOW] 쥘리아 집합 출력하기 (0) | 2018.07.04 |
[PYTHON/TENSORFLOW] 망델브로 집합 출력하기 (0) | 2018.07.04 |
[PYTHON/TENSORFLOW] slice 함수 : 이미지 자르기 (0) | 2018.07.04 |
[PYTHON/TENSORFLOW] matrix_determinant 함수 : 행렬식 값 구하기 (0) | 2018.07.03 |
[PYTHON/TENSORFLOW] add 함수 : 행렬 더하기 (0) | 2018.07.03 |
[PYTHON/TENSORFLOW] matmul 함수 : 행렬 곱셈하기 (0) | 2018.07.03 |
[PYTHON/TENSORFLOW] convert_to_tensor 함수 : 2차원 텐서 구하기 (0) | 2018.07.03 |
댓글을 달아 주세요