Commit 2acb56c7 authored by Amelie Royer's avatar Amelie Royer

Adding Fashion MNIST

parent 4a31eea4
......@@ -35,6 +35,7 @@ The loader simply builds a proper parsing function to extract data from the TFRe
| ------- | ---- | ------ | --- |
| CelebA | [CelebA](http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html) | ![celeba_thumb](images/celeba.png) | image, bounding-box, attributes, landmarks |
| CartoonSet | [CartoonSet](https://google.github.io/cartoonset/) | ![cartoonset_thumb](images/cartoonset.png) | image, bounding-box, attributes |
| Fashion MNIST| [Fashion MNIST](https://github.com/zalandoresearch/fashion-mnist) | ![fashion_mnist_thumb](images/fashion_mnist.png) | image, class, index|
| MNIST | [MNIST](http://yann.lecun.com/exdb/mnist/) | ![mnist_thumb](images/mnist.png) | image, digit-class, index |
| MNIST-M | [MNIST-M](http://yaroslav.ganin.net/) | ![mnistm_thumb](images/mnistm.png) | image, digit-class, index |
| M2NIST | [M2NIST](https://www.kaggle.com/farhanhubble/multimnistm2nist/home) | ![m2nist_thumb](images/m2nist.png) | image, segmentation-mask, index |
......
from __future__ import print_function
#####################################
# MNIST dataset #
# http://yann.lecun.com/exdb/mnist/ #
#####################################
import codecs
import os
import numpy as np
import tensorflow as tf
from .tfrecords_utils import *
from .mnist import MNISTConverter, MNISTLoader
class FashionMNISTConverter(MNISTConverter):
def __init__(self, data_dir):
"""Initialize the object for the fashion MNIST dataset in `data_dir`"""
print('Loading original FashionMNIST data from', data_dir)
self.data = []
for name, key in [('train', 'train'), ('test', 't10k')]:
images = os.path.join(data_dir, '%s-images-idx3-ubyte' % key)
labels = os.path.join(data_dir, '%s-labels-idx1-ubyte' % key)
if not os.path.isfile(images) or not os.path.isfile(labels):
print('Warning: Missing %s data' % name)
else:
self.data.append((name, images, labels))
class FashionMNISTLoader(MNISTLoader):
classes_names = ['T-shirt/top', 'Trouser', 'Pullover', 'Dress', 'Coat', 'Sandal', 'Shirt',
'Sneaker', 'Bag', 'Ankle boot']
def __init__(self, image_size=None, verbose=False):
super(FashionMNISTLoader, self).__init__(image_size=image_size, verbose=verbose)
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment