• Stars
    star
    125
  • Rank 286,335 (Top 6 %)
  • Language
    Python
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Convert CIFAR-10 and CIFAR-100 datasets into PNG images

cifar2png

Convert CIFAR-10 or CIFAR-100 dataset into PNG images.

Install

$ pip install cifar2png

Usage

$ cifar2png <dataset> <output_dir> [--name-with-batch-index]

  • dataset: Specify cifar10 or cifar100 or cifar100superclass
  • output_dir: Path to save PNG converted dataset (The directory will be created automatically).
  • --name-with-batch-index: (optional) Name image files based on batch name and index of cifar10/cifar100 dataset.

Automatically download cifar-10-python.tar.gz or cifar-100-python.tar.gz to the current directory from CIFAR-10 and CIFAR-100 datasets when you run this tool.

Examples

CIFAR-10

$ cifar2png cifar10 path/to/cifar10png

CIFAR-10 with naming option

$ cifar2png cifar10 path/to/cifar10png --name-with-batch-index

CIFAR-100

$ cifar2png cifar100 path/to/cifar100png

CIFAR-100 with superclass

$ cifar2png cifar100superclass path/to/cifar100png

Structure of output directory

CIFAR-10 and CIFAR-100

PNG images of CIFAR-10 are saved in 10 subdirectories of each label under the test and train directories as below.
(CIFAR-100 are saved in the same way with 100 subdirectories)

$ tree -d path/to/cifar10png
path/to/cifar10png
โ”œโ”€โ”€ test
โ”‚ย ย  โ”œโ”€โ”€ airplane
โ”‚ย ย  โ”œโ”€โ”€ automobile
โ”‚ย ย  โ”œโ”€โ”€ bird
โ”‚ย ย  โ”œโ”€โ”€ cat
โ”‚ย ย  โ”œโ”€โ”€ deer
โ”‚ย ย  โ”œโ”€โ”€ dog
โ”‚ย ย  โ”œโ”€โ”€ frog
โ”‚ย ย  โ”œโ”€โ”€ horse
โ”‚ย ย  โ”œโ”€โ”€ ship
โ”‚ย ย  โ””โ”€โ”€ truck
โ””โ”€โ”€ train
    โ”œโ”€โ”€ airplane
    โ”œโ”€โ”€ automobile
    โ”œโ”€โ”€ bird
    โ”œโ”€โ”€ cat
    โ”œโ”€โ”€ deer
    โ”œโ”€โ”€ dog
    โ”œโ”€โ”€ frog
    โ”œโ”€โ”€ horse
    โ”œโ”€โ”€ ship
    โ””โ”€โ”€ truck
$ tree path/to/cifar10png/test/airplane
path/to/cifar10png/test/airplane
โ”œโ”€โ”€ 0001.png
โ”œโ”€โ”€ 0002.png
โ”œโ”€โ”€ 0003.png
(..snip..)
โ”œโ”€โ”€ 0998.png
โ”œโ”€โ”€ 0999.png
โ””โ”€โ”€ 1000.png

When dataset created using the --name-with-batch-index option.

$ tree path/to/cifar10png/train/airplane
path/to/cifar10png/train/airplane
โ”œโ”€โ”€ data_batch_1_index_0029.png
โ”œโ”€โ”€ data_batch_1_index_0030.png
โ”œโ”€โ”€ data_batch_1_index_0035.png
(..snip..)
โ”œโ”€โ”€ data_batch_5_index_9941.png
โ”œโ”€โ”€ data_batch_5_index_9992.png
โ””โ”€โ”€ data_batch_5_index_9994.png

CIFAR-100 with superclass

PNG images of CIFAR-100 with superclass are saved in each label directories under the superclass subdirectories under the test and train directories as below.

$ tree -d path/to/cifar100png
path/to/cifar100png
โ”œโ”€โ”€ test
โ”‚ย ย  โ”œโ”€โ”€ aquatic_mammals
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ beaver
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ dolphin
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ otter
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ seal
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ whale
โ”‚ย ย  โ”œโ”€โ”€ fish
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ aquarium_fish
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ flatfish
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ ray
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ shark
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ trout
โ”‚ย ย  โ”œโ”€โ”€ flowers
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ orchid
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ poppy
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ rose
โ”‚ย ย  โ”‚ย ย  โ”œโ”€โ”€ sunflower
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ tulip
(..snip..)
    โ”œโ”€โ”€ trees
    โ”‚ย ย  โ”œโ”€โ”€ maple_tree
    โ”‚ย ย  โ”œโ”€โ”€ oak_tree
    โ”‚ย ย  โ”œโ”€โ”€ palm_tree
    โ”‚ย ย  โ”œโ”€โ”€ pine_tree
    โ”‚ย ย  โ””โ”€โ”€ willow_tree
    โ”œโ”€โ”€ vehicles_1
    โ”‚ย ย  โ”œโ”€โ”€ bicycle
    โ”‚ย ย  โ”œโ”€โ”€ bus
    โ”‚ย ย  โ”œโ”€โ”€ motorcycle
    โ”‚ย ย  โ”œโ”€โ”€ pickup_truck
    โ”‚ย ย  โ””โ”€โ”€ train
    โ””โ”€โ”€ vehicles_2
        โ”œโ”€โ”€ lawn_mower
        โ”œโ”€โ”€ rocket
        โ”œโ”€โ”€ streetcar
        โ”œโ”€โ”€ tank
        โ””โ”€โ”€ tractor

More Repositories

1

imgdupes

Identifying and removing near-duplicate images using perceptual hashing.
Python
300
star
2

mxnet-finetuner

An all-in-one Deep Learning toolkit for image classification to fine-tuning pretrained models using MXNet.
Jupyter Notebook
103
star
3

kaggle-kuzushiji-recognition-2019

Python
26
star
4

filter-response-normalization-layer-pytorch

Unofficial PyTorch implementation of "Filter Response Normalization Layer: Eliminating Batch Dependence in the Training of Deep Neural Networks"
Python
21
star
5

pytorch-finetuner

Python
15
star
6

kaggle-seti-2021

Python
10
star
7

heroku-buildpack-mecab-ipadic-neologd

Shell
8
star
8

slack-inviteviz

Visualizing an invitation graph of your slack team
Ruby
7
star
9

string-codec

Encoder/Decoder of various algorithm
JavaScript
6
star
10

jirou_deep

ใƒฉใƒผใƒกใƒณไบŒ้ƒŽ่ญ˜ๅˆฅbot(@jirou_deep)
Python
6
star
11

imgtile

A script to tile images
Python
4
star
12

rpi-hubot-docker-template

Template of Hubot Docker container on Raspberry Pi
CoffeeScript
3
star
13

hmms

้›ป่ปŠใ‚„ใƒใ‚นใŒๅˆฐ็€ใ™ใ‚‹ใพใงใฎๆ™‚ๅˆปใ‚’ไธ€่ฆงใงใ‚ซใ‚ฆใƒณใƒˆใƒ€ใ‚ฆใƒณใ™ใ‚‹Webใ‚ขใƒ—ใƒช
JavaScript
3
star
14

mecab-api-hiragana

gooใƒฉใƒœใฎใ€Œใฒใ‚‰ใŒใชๅŒ–ใ€APIใฎใ‚ฏใƒญใƒผใƒณ
Ruby
3
star
15

rpi-ruby

RPi-compatible Docker base image with Ruby
Makefile
2
star
16

face-collector

Collect faces from images and/or videos
Python
2
star
17

nat_editor

RV-S340NEใฎNAT่จญๅฎšใ‚’CLIใง
Ruby
2
star
18

smog-prototype

CSS
2
star
19

devo

CoffeeScript
2
star
20

tbla

ๆฑๆญฆใƒใ‚นOn-Lineใฎใƒใ‚น็พๅœจไฝ็ฝฎๆƒ…ๅ ฑใ‚’ใƒ‘ใƒผใ‚นใ—ใฆjsonใง่ฟ”ๅด
Ruby
2
star
21

growthviz

ๅญไพ›ใฎๅ†™็œŸใ‹ใ‚‰่‡ชๅ‹•็š„ใซๆˆ้•ทใŒๅˆ†ใ‹ใ‚‹ใ‚‚ใฎใ‚’ไฝœใ‚‹
Python
2
star
22

hubot-slack-latex-formula

A hubot script that creates latex formula images and upload it to Slack
CoffeeScript
2
star
23

photoshare

็”ปๅƒใ‚ฎใƒฃใƒฉใƒชใƒผไฝœๆˆใ‚นใ‚ฏใƒชใƒ—ใƒˆ
JavaScript
1
star
24

hubot-slack-ikku

ไธ€ๅฅ
CoffeeScript
1
star
25

tensorflow-mnist-docker

1
star
26

hubot-slack-welcome

CoffeeScript
1
star
27

rpi-redis

RPi-compatible Docker base image with Redis
Shell
1
star
28

clitest

node.js clitool test with power-assert and coffee-script
CoffeeScript
1
star
29

timeliner

This hubot will send all of the messages on Slack in #timeline
CoffeeScript
1
star
30

slack-name-cards-prototype

HTML
1
star
31

docker-ce-debian-arm64

docker-ce debian arm64 deb packages
1
star
32

autometa

Generate various data from Excel spreadsheet
CoffeeScript
1
star
33

rpi-node-armv7

RPi-compatible Docker base image with Node.js ARMv7
Makefile
1
star