GithubHelp home page GithubHelp logo

goongong / caffe-cifar-10-and-cifar-100-datasets-preprocessed-to-hdf5 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from guillaume-chevalier/caffe-cifar-10-and-cifar-100-datasets-preprocessed-to-hdf5

0.0 2.0 0.0 56.03 MB

Both deep learning datasets can be imported in python directly with h5py (HDF5 format). The datasets can be directly imported or converted with a python script.

Python 100.00%

caffe-cifar-10-and-cifar-100-datasets-preprocessed-to-hdf5's Introduction

Caffe cifar-10 and cifar-100 datasets preprocessed to HDF5 (can be opened in PyCaffe with h5py)

Both deep learning datasets can be imported in python directly with h5py (HDF5 format) once downloaded and converted by the script.

NOTE: For each dataset (separately), the training set has been shuffled and put in a single batch, it was originally split into 5 files and not shuffled. Test sets has also been shuffled, but remained separated from the training sets.

Usage

If you got the requirements or got caffe installed, you can simply do this, with the cifar-10 dataset as an example:

wget https://raw.githubusercontent.com/guillaume-chevalier/Caffe-cifar-10-and-cifar-100-datasets-preprocessed-to-HDF5/master/download-and-convert-cifar-10.py

python download-and-convert-cifar-10.py

Not shuffling datasets

If you do not want the datasets to be shuffled nor merged, my scripts can be a good starting point for the complete conversion of the cifar 10 and 100 datasets to the HDF5 caffe format. You may refer to this interesting tutorial to understand better how to do the conversion: https://github.com/BVLC/caffe/blob/master/examples/02-brewing-logreg.ipynb

Datasets shape info

cifar-10

Each element are of shape 3*32*32: print(X.shape) --> (50000, 3, 32, 32)

From the Caffe documentation: "The conventional blob dimensions for batches of image data are number N x channel K x height H x width W."

The labels are integer (not length 10 vectors with one-hot encoding). As an example, caffe does the encoding itself with the SoftmaxWithLoss layer when the previous layer is an InnerProduct with setting num_output=10.

cifar-100

The data has the same shape than in the cifar-10 dataset. However, the dataset has two labels per image: while building caffe layers, the label data will not exist in the HDF5 format, it will be label_coarse and label_fine. Please refer to the original datasets' page for info about the number of classes in each coarse and fine labels. Also note that I did NOT tested the cifar-100 dataset, only the cifar-10.

Link to original datasets

https://www.cs.toronto.edu/~kriz/cifar.html

caffe-cifar-10-and-cifar-100-datasets-preprocessed-to-hdf5's People

Contributors

guillaume-chevalier avatar

Watchers

 avatar  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.