Parses the binary files of the CIFAR-10 data set and returns them as a pair of tuples (data, labels)
with of type and dimension:
- Training data: Array4<u8> [50_000, 3, 32, 32]
and Array2<u8> [50_000, 10]
- Testing data: Array4<u8> [10_000, 3, 32, 32]
and Array2<u8> [10_000, 10]
OR
Array2<f32>
structures in the same arrangement. A random image from each dataset and the associated label can be displayed upon parsing. A tar.gz
file with the original binaries can be found here. This can be download manually, or automatically using the download
feature.
```rust use cifar_ten::*;
fn main() { let (traindata, trainlabels, testdata, testlabels) = Cifar10::default() .showimages(true) .downloadandextract(true) // must enable the "download" feature .build() // or .buildasflatf32() .expect("Failed to build CIFAR-10 data"); } ``` To add as a dependency, please use:
toml
[dependencies]
cifar-ten = "0.1"
Note: Previous commits have included the dataset, which will make the download size large. For development, it's suggested to
$ git clone --depth=1 https://github.com/quietlychris/cifar-ten.git