https://github.com/joeyism/py-cifar10
This library was created to allow an easy usage of CIFAR 10 DATA. This is a wrapper around the instructions givn on the CIFAR 10 site
https://github.com/joeyism/py-cifar10
cifar cifar-10 cifar10 data machine-learning machinelearning
Last synced: 11 months ago
JSON representation
This library was created to allow an easy usage of CIFAR 10 DATA. This is a wrapper around the instructions givn on the CIFAR 10 site
- Host: GitHub
- URL: https://github.com/joeyism/py-cifar10
- Owner: joeyism
- License: apache-2.0
- Created: 2021-01-27T22:26:03.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-03-21T20:42:08.000Z (over 4 years ago)
- Last Synced: 2025-05-20T12:53:53.549Z (about 1 year ago)
- Topics: cifar, cifar-10, cifar10, data, machine-learning, machinelearning
- Language: Python
- Homepage:
- Size: 19.5 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CIFAR 10 Dataset Library
This library was created to allow an easy usage of [CIFAR 10 DATA](https://www.cs.toronto.edu/~kriz/cifar.html). This is a wrapper around the instructions given on the [CIFAR 10 Site](https://www.cs.toronto.edu/~kriz/cifar.html)
## Installation
```bash
pip3 install cifar10
```
## Sample Usage
```python
import cifar10
# Train data
for image, label in cifar10.data_batch_generator():
image # numpy array of an image, which is of shape 32 x 32 x 3
label # integer value of the image label
# Test data
for image, label in cifar10.test_batch_generator():
image # numpy array of an image, which is of shape 32 x 32 x 3
label # integer value of the image label
```
## API
### data_batch_generator
Returns a generator of each image and label pair for data batch
```python
data_batch_generator(cache_location: str=".") -> Iterator[Tuple[np.array, int]]
```
#### parameters
* `cache_location` (default: library folder location): where to cache the cifar10 data
### test_batch_generator
Returns a generator of each image and label pair for test batch
```python
test_batch_generator(cache_location: str=".") -> Iterator[Tuple[np.array, int]]
```
#### parameters
* `cache_location` (default: library folder location): where to cache the cifar10 data
### meta
Returns the raw meta file
```python
meta(cache_location: str=".") -> Dict[bytes, Any]
```
#### parameters
* `cache_location` (default: library folder location): where to cache the cifar10 data
### image_label_map
Returns a dictionary of label
```
{
0: 'airplane',
1: 'automobile',
...
}
```
```python
image_label_map(cache_location: str=".") -> Dict[int, str]
```
#### parameters
* `cache_location` (default: library folder location): where to cache the cifar10 data