Skip to content

This utility will convert raw MNIST data files to PGM image files in labeled directories

Notifications You must be signed in to change notification settings

mandeluna/MNIST-PGM-Converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

MNIST to PGM Converter

This utility will convert raw MNIST data files to PGM image files in labeled directories.

Motivation

MNIST is a database of handwritten digits that are commonly used for machine learning tutorials.

PGM is a very simple image format for grayscale images.

Apple's Create ML framework will import images data from labeled directories, and some people may find it useful to view the images directly from the file system.

Alternatives

If you are using Python you are unlikely to need this.

Most people learning the MNIST tutorial use Keras mnist.load_data() function from a Python workspace to obtain their data.

The Keras function does not return the data directly from the MNIST Homepage (and no automated scripts should do that), but it takes a "pickled" or serialized Python binary object file from the Google servers.

Usage

To use this utility, download labels and images from the MNIST data, uncompress them, and run the following command to put them into labeled directories:

mkdir train
mkdir test
convert_to_labeled_directories train-labels-idx1-ubyte train-images-idx3-ubyte train
convert_to_labeled_directories t10k-labels-idx1-ubyte t10k-images-idx3-ubyte test

This utility has no dependencies on OS-specific features or third-party libraries.

Compiling

To compile on Mac OS X: clang convert_to_labeled_directories.c -o convert_to_labeled_directories

To compile on Linux: gcc -I/usr/include/bsd -DLIBBSD_OVERLAY -lbsd -o convert_to_labeled_directories

About

This utility will convert raw MNIST data files to PGM image files in labeled directories

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published