Skip to main content

Command Line utility for cost of aws.

Project description

h5cv

PyPI version Build Status

show hdf5 file in image file.

get start

$ ls -lh evaluation/
total 2936
-rw-r--r--@ 1 hiroshi.toyama  1522739515    37K  7  3  2019 car1.jpg
-rw-r--r--@ 1 hiroshi.toyama  1522739515   188K  7  3  2019 cat1.jpg
-rw-r--r--  1 hiroshi.toyama  1522739515   137K  7  3  2019 dog1.jpg
-rw-r--r--  1 hiroshi.toyama  1522739515    51K  7  3  2019 dog2.jpg
-rw-r--r--  1 hiroshi.toyama  1522739515    77K  7  3  2019 dog3.jpg
-rw-r--r--  1 hiroshi.toyama  1522739515   8.8K  7  3  2019 dog4.jpg
-rw-r--r--@ 1 hiroshi.toyama  1522739515    42K  7  3  2019 monitor1.jpg
-rw-r--r--  1 hiroshi.toyama  1522739515   267K  7  3  2019 person1.jpg
-rw-r--r--  1 hiroshi.toyama  1522739515   170K  7  3  2019 person2.jpg
-rw-r--r--  1 hiroshi.toyama  1522739515   467K  7  3  2019 room1.jpg

$ h5cv -H test.h5 --store numpy write -g 'evaluation/*.jpg' -a
2020-03-06 19:13:35,972 INFO - compression => None
2020-03-06 19:13:35,973 INFO - generate numpy: evaluation/dog4.jpg => test.h5:evaluation/dog4.jpg
2020-03-06 19:13:35,977 INFO - generate numpy: evaluation/car1.jpg => test.h5:evaluation/car1.jpg
2020-03-06 19:13:35,978 INFO - generate numpy: evaluation/dog3.jpg => test.h5:evaluation/dog3.jpg
2020-03-06 19:13:35,980 INFO - generate numpy: evaluation/monitor1.jpg => test.h5:evaluation/monitor1.jpg
2020-03-06 19:13:35,982 INFO - generate numpy: evaluation/dog2.jpg => test.h5:evaluation/dog2.jpg
2020-03-06 19:13:35,983 INFO - generate numpy: evaluation/dog1.jpg => test.h5:evaluation/dog1.jpg
2020-03-06 19:13:35,985 INFO - generate numpy: evaluation/cat1.jpg => test.h5:evaluation/cat1.jpg
2020-03-06 19:13:35,987 INFO - generate numpy: evaluation/person1.jpg => test.h5:evaluation/person1.jpg
2020-03-06 19:13:35,989 INFO - generate numpy: evaluation/person2.jpg => test.h5:evaluation/person2.jpg
2020-03-06 19:13:35,991 INFO - generate numpy: evaluation/room1.jpg => test.h5:evaluation/room1.jpg

$ h5cv -H test.h5 ls -r
evaluation
evaluation/car1.jpg
evaluation/cat1.jpg
evaluation/dog1.jpg
evaluation/dog2.jpg
evaluation/dog3.jpg
evaluation/dog4.jpg
evaluation/monitor1.jpg
evaluation/person1.jpg
evaluation/person2.jpg
evaluation/room1.jpg

h5cv command

list keys

$ h5cv -H test.h5 ls [-r] [key]

show dataset in hdf5.

$ h5cv -H test.h5 show /some_group/test.jpg.np

imgcat in hdf5.

$ h5cv -H test.h5 imgcat /some_group/test.jpg

write in hdf5.

$ h5cv -H test.h5 \
  [--store [numpy|binary]] \
  write \
  -g 'images/*.jpg' \
  [--output-group mygroup] \
  [--compression gzip] \
  [--append]

delete dataset or group in hdf5.

$ h5cv -H test.h5 delete /some_group/test.jpg

custom generator

from h5cv.core import Core
from h5cv.generator import Generator
from PIL import Image


class MyGenerator(Generator):
    def __getitem__(self, path):
        print(f"custom generate {path}")
        return Image.open(path)

Core(
    hdf5="test.h5"
).write(
    "evaluation/*.jpg",
    generator=MyGenerator(),
    compression="gzip"
)

Installation

pip install h5cv

Installation from github

pip install git+https://github.com/toyama0919/h5cv

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for h5cv, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size h5cv-0.1.1.tar.gz (331.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page