Learn practical skills, build real-world projects, and advance your career
 
%matplotlib inline    
import tensorflow as tf
import matplotlib
from matplotlib import pyplot as plt
from skimage import io        # to read images
# opening and viewing an image 
image = io.imread("bird_pic_by_benjamin_planche.png") # 1 image uploaded 
# 2 image viwing 
print("Image shape: {}".format(image.shape))
plt.imshow(image, cmap=plt.cm.gray)
Image shape: (680, 608)
<matplotlib.image.AxesImage at 0x2525f8f6ba8>
Notebook Image
#converting the image into a tensor in order to do som tensorflow operations
image = tf.convert_to_tensor(image, tf.float32, name="input_image")
print("Tensor shape: {}".format(image.shape)) # testing image shape after tensor 
Tensor shape: (680, 608)