Created
April 4, 2018 10:01
-
-
Save prerakmody/d3354fd71b238031a9deb35f355ee337 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
img_url = '/home/play/data/GOD_DATASET/open_datasets/cityscapes/gtFine_trainvaltest/gtFine/train/aachen/aachen_000000_000019_gtFine_color.png' | |
# img_url = '/home/play/data/GOD_DATASET/open_datasets/mapillary/mapillary-vistas-dataset_public_v1.0/training/instances/QOJJHmXYAiRVW3rDK3gs0g.png' | |
import cv2 | |
import skimage.io | |
import numpy as np | |
img = cv2.imread(img_url,cv2.IMREAD_UNCHANGED) | |
print ('\nCV2 : ', np.unique(img)) | |
img = skimage.io.imread(img_url) | |
print ('\nskimage : ', np.unique(img)) | |
import tensorflow as tf | |
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' | |
img = tf.image.decode_png(tf.read_file(img_url), channels=1) | |
with tf.Session() as sess: | |
img = sess.run([img]) | |
print ('\ntensorflow : ', np.unique(img)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment