Git Product home page Git Product logo

mnist2svhn's Introduction

MNIST2SVHN

Convert MNIST dataset to a SVHN-like real life dataset.

MNIST (+ My Original Dataset)

The MNIST+ dataset pickle file can be downloaded from Mega It contains 140,000 examples (120,000 + 20,000)
If you wish to start generating your own dataset from scratch, you can download this dataset, and use MNIST2SVHN-plus-ultra.ipynb to generate.

MNIST2SVHN dataset (Converted)

You can also download pre-converted dataset from Mega

How to read the Pickle files

This is an example of reading the pickle file "Dataset_new.pkl".

At the end, you will get a list of features named "total_x" and a list of labels "total_y"

>>> from six.moves import cPickle as pickle
>>> f = open("Dataset_new.pkl", "rb")
>>> letter_set = pickle.load(f, encoding="latin1")
>>> f.close()
>>> type(letter_set)
<class 'tuple'>
>>> len(letter_set)
2
>>> total_x = None
>>> total_y = None
>>> for i in range(len(letter_set)):
...     if letter_set[i] == "EOF":
...             break
...     x = letter_set[i][0]
...     y = letter_set[i][1]
...     if total_x is None:
...             total_x = x
...             total_y = y
...     else:
...             total_x = np.concatenate((total_x, x), axis=0)
...             total_y = np.concatenate((total_y, y), axis=0)
...     print(len(total_x))
...
140000

Take a look the structure of label.

>>> total_y[:10]
[[2, (7, 7), (24, 35)],
 [6, (11, 5), (25, 25)],
 [5, (8, 2), (23, 28)],
 [1, (21, 8), (33, 28)],
 [6, (21, 21), (34, 47)],
 [0, (19, 6), (33, 26)],
 [4, (12, 8), (28, 28)],
 [4, (6, 4), (22, 29)],
 [1, (15, 6), (25, 26)],
 [7, (13, 7), (31, 27)]]

The label follows format of

[class], [top_left_point_coordinate_tuple], [bottom_right_point_coordinate_tuple]

mnist2svhn's People

Contributors

waltpeter avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.