EMNIST
Extended MNIST - Python Package
The EMNIST Dataset
The EMNIST Dataset is an extension to the original MNIST dataset to also include letters. For more details, see the EMNIST web page and the paper associated with its release:
Cohen, G., Afshar, S., Tapson, J., & van Schaik, A. (2017). EMNIST: an extension of MNIST to handwritten letters. Retrieved from http://arxiv.org/abs/1702.05373
The EMNIST Python Package
This package is a convenience wrapper around the EMNIST Dataset. The package provides functionality to automatically download and cache the dataset, and to load it as numpy arrays, minimizing the boilerplate necessary to make use of the dataset. (NOTE: The author of the Python package is not affiliated in any way with the authors of the dataset and the associated paper.)
Installation
To install the EMNIST Python package along with its dependencies, run the following command:
pip install emnist
The dataset itself is automatically downloaded and cached when needed. To preemptively download the data and avoid a delay later during the execution of your program, execute the following command after installation:
python -c "import emnist; emnist.ensure_cached_data()"
Alternately, if you have already downloaded the original IDX-formatted dataset from the EMNIST web page,
copy or move it to ~/.cache/emnist/, where ~ is your home folder, and rename it from gzip.zip to
emnist.zip. The package will use the existing file rather than downloading it again.
Usage
Usage of the EMNIST Python package is designed to be very simple.
To get a listing of the available subsets:
>>> from emnist import list_datasets
>>> list_datasets()
['balanced', 'byclass', 'bymerge', 'digits', 'letters', 'mnist']
(See the EMNIST web page for details on each of these subsets.)
To load the training samples for the 'digits' subset:
>>> from emnist import extract_training_samples
>>> images, labels = extract_training_samples('digits')
>>> images.shape
(240000, 28, 28)
>>> labels.shape
(240000,)
To load the test samples for the 'digits' subset:
>>> from emnist import extract_test_samples
>>> images, labels = extract_test_samples('digits')
>>> images.shape
(40000, 28, 28)
>>> labels.shape
(40000,)
Data is extracted directly from the downloaded compressed file to minimize disk usage, and is returned as standard numpy arrays.
Metadata
Release files for emnist 0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| emnist-0.0.tar.gz | 6.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| emnist-0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.8 kB
Release files / emnist-0.0.tar.gz
| Download URL | emnist-0.0.tar.gz |
|---|---|
| Size | 6.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
755fcc4b63ed12740a9842fa9e8b22e4df019fc2d11b1f4bd0495fd56613ef5e
|
|
BLAKE2b-256 checksum How to use checksums |
3af3679ed5798a04b21cbd257e37509f2bbef306815a52e4ef580b0f70ed756f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7
|
Release files / emnist-0.0-py3-none-any.whl
| Download URL | emnist-0.0-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
80a3d062aab1f28fc48c895017051d44b3ae17e5bfc4040660714e9b0682d8fc
|
|
BLAKE2b-256 checksum How to use checksums |
d1f478b24acbef9e8fe976dda700f16a3606f3b8363b015bc555f8050fbbd8ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.1.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7
|
Security for emnist 0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.