I am trying to follow the sample of image classification of TensorFlow (https://www.tensorflow.org/tutorials/images/classification), and want to replace the dataset with that of oxford_flowers102 (https://www.tensorflow.org/datasets/catalog/oxford_flowers102).
I tried to change the codes a few times, but the image_count printed stays 0 and it is so strange.
import pathlib
data_dir = tf.keras.utils.get_file(origin='https://www.robots.ox.ac.uk/~vgg/data/flowers/102/102flowers.tgz',fname='102flowers', untar=True)
data_dir = pathlib.Path(data_dir)
image_count = len(list(data_dir.glob('*.jpg')))
print(image_count)
and
import pathlib
dataset_url = "https://www.robots.ox.ac.uk/~vgg/data/flowers/102/102segmentations.tgz"
data_dir = tf.keras.utils.get_file('102segmentations', origin=dataset_url, untar=True, extract=True)
data_dir = pathlib.Path(data_dir)
image_count = len(list(data_dir.glob('*/*jpg')))
print(image_count)
I also try to compare the two files with !wget
!wget https://www.robots.ox.ac.uk/~vgg/data/flowers/102/102flowers.tgz
and
!wget https://storage.googleapis.com/download.tensorflow.org/example_images/flower_photos.tgz
They come out with different formats, [application/x-gzip]and [application/x-compressed-tar] respectively, is this matter? Or what did I do wrongly?
Also, I have no idea how can I start with the Oxford dataset, it seems already finished all testing. Can anyone help? Thank you!