PHPackages                             rafaelglikis/mnist-reader - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. rafaelglikis/mnist-reader

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rafaelglikis/mnist-reader
=========================

Reader for MNIST dataset

v1.2(7y ago)18MITPHPPHP &gt;=7.1

Since Nov 9Pushed 7y ago1 watchersCompare

[ Source](https://github.com/rafaelglikis/mnist-reader)[ Packagist](https://packagist.org/packages/rafaelglikis/mnist-reader)[ Docs](https://github.com/rafaelglikis/mnist-reader)[ RSS](/packages/rafaelglikis-mnist-reader/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

Mnist Reader
============

[](#mnist-reader)

A php file reader for Yann Lecun's MNIST handwritten digits database. The input data can be found on his site at:

Requirements
------------

[](#requirements)

- PHP 7.1

Installation
------------

[](#installation)

```
composer require rafaelglikis/mnist-reader
```

Usage
-----

[](#usage)

```
use MnistReader\MnistReader;
use MnistReader\Image;

$mnistReader = new MnistReader("data");

try {
    $mnistReader->loadData();
} catch (Exception $e){
    print $e->getMessage() . "\n";
    die();
}

$images = $mnistReader->getImages();
```

Access to label

```
print $images['train'][0]->getLabel();
```

Print Ascii representation or numbers

```
$images['train'][0]->printAscii();
$images['train'][0]->printChars();
```

Save the image

```
$images['train'][0]->save('train.png');
```

Get raw data of an image

```
$pixels = $images['train'][0]->getPixels();
```

Example with test set

```
print $images['test'][0]->getLabel();
$images['test'][0]->printAscii();
$images['test'][0]->printChars();
$images['test'][0]->save('test.png');
$pixels = $images['test'][0]->getPixels();
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

2737d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b8d3568e060e195f7513454acd42621277bf1d115793af8c52d7fc33fd78dc4f?d=identicon)[rafaelglikis](/maintainers/rafaelglikis)

---

Top Contributors

[![rafaelglikis](https://avatars.githubusercontent.com/u/4549981?v=4)](https://github.com/rafaelglikis "rafaelglikis (4 commits)")

---

Tags

mnist

### Embed Badge

![Health badge](/badges/rafaelglikis-mnist-reader/health.svg)

```
[![Health](https://phpackages.com/badges/rafaelglikis-mnist-reader/health.svg)](https://phpackages.com/packages/rafaelglikis-mnist-reader)
```

###  Alternatives

[nexucis/es-index-helper

Elasticsearch Index Helper for php, which allows you to manage your indices without any downtime

1519.5k](/packages/nexucis-es-index-helper)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
