Created
October 9, 2019 17:27
-
-
Save visionNoob/d8e0c367298fd0a8584d60dd1318a24e to your computer and use it in GitHub Desktop.
tfds pascal voc example
This file contains hidden or 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
import warnings | |
warnings.filterwarnings("ignore") | |
import tensorflow_datasets as tfds | |
import tensorflow as tf | |
import matplotlib.pyplot as plt | |
%matplotlib inline | |
# tfds works in both Eager and Graph modes | |
tf.compat.v1.enable_eager_execution() | |
dataset = tfds.load("voc2007", split=tfds.Split.TRAIN, batch_size=16) | |
dataset = dataset.shuffle(10) | |
for feature in dataset.take(1): | |
print(feature['image'].shape) | |
plt.imshow(feature['image'][5]) | |
plt.show() | |
print(feature['objects']['bbox'][5]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment