Metadata-Version: 2.1
Name: hasy-tools
Version: 0.1.2
Summary: Convenience functions for the HASY dataset
Home-page: https://github.com/MartinThoma/hasy_tools
Author: Martin Thoma
Author-email: info@martin-thoma.de
Maintainer: Martin Thoma
Maintainer-email: info@martin-thoma.de
License: MIT
Download-URL: https://github.com/MartinThoma/hasy_tools
Keywords: Machine Learning,Data Science,classifiers,Classification,utility
Platform: Linux
Classifier: Development Status :: 7 - Inactive
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Scientific/Engineering :: Visualization
Classifier: Topic :: Software Development
Classifier: Topic :: Utilities
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: Pillow
Requires-Dist: scikit-learn
Requires-Dist: matplotlib

[![PyPI version](https://badge.fury.io/py/hasy_tools.svg)](https://badge.fury.io/py/hasy_tools)
[![Python Support](https://img.shields.io/pypi/pyversions/hasy_tools.svg)](https://pypi.org/project/hasy_tools/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

# hasy_tools

`hasy_tools` is a support package for the HASY dataset. The dataset is
described in [The HASYv2 dataset](https://arxiv.org/pdf/1701.08380.pdf).

The HASY dataset contains handwritten symbols obtained via [Detexify](http://detexify.kirelabs.org/classify.html)
and [write-math.com](http://write-math.com). The data was rendered and is similar
to MNIST.


## Installation

```bash
$ pip install git+https://github.com/MartinThoma/hasy_tools.git
```

It can, of course, also be installed via PyPI.


## Usage

```python-repl
>>> import hasy_tools
>>> data = hasy_tools.load()
>>> data.keys()
dict_keys(['x_train', 'y_train', 'x_test', 'y_test', 's_train', 's_test', 'labels'])
>>> len(data['labels'])
369
>>> data['x_train'].shape
(151241, 32, 32, 1)
>>> x_train = hasy_tools.preprocess(data['x_train'])
>>> y_train = np.eye(hasy_tools.n_classes)[y_train.squeeze()]
```


