https://github.com/boolka/mnistidx
mnist database api
https://github.com/boolka/mnistidx
api database mnist mnist-database mnist-model
Last synced: about 2 months ago
JSON representation
mnist database api
- Host: GitHub
- URL: https://github.com/boolka/mnistidx
- Owner: boolka
- License: mit
- Created: 2025-02-03T14:33:40.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-10T16:58:44.000Z (over 1 year ago)
- Last Synced: 2025-03-28T08:17:02.687Z (about 1 year ago)
- Topics: api, database, mnist, mnist-database, mnist-model
- Language: Go
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mnistidx
Mnistidx module provides api to work with mnist databases.
## Usage
```go
package main
import (
"os"
)
func main() {
imagesFile, err := os.Open("filepath/to/images/database/file")
if err != nil {
panic(err)
}
labelsFile, err := os.Open("filepath/to/labels/database/file")
if err != nil {
panic(err)
}
i, err := mnistidx.NewIDX(imagesFile, labelsFile)
if err != nil {
panic(err)
}
buf := make([]byte, i.ImageBufSize())
for {
l, err := i.Read(buf)
if err == io.EOF {
break
}
// buf contains image
// l represent current label
}
}
```
## Tests
If you run tests mnist databases automatically downloaded to `~/.mnistdb` directory
## Info
For additional info look at [mnistdb](https://yann.lecun.com/exdb/mnist/)