gregunz / h5torch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

h5torch

Install

pip install git+https://github.com/gregunz/h5torch

Usage

Example 1: convert tensors into an hdf5 dataset

import torch

path = "../data/dataset.hdf5"
data = (torch.rand(3, 224, 224) for _ in range(1000))


from h5torch.utils import convert_tensors_to_default_h5_torch_datasets

convert_tensors_to_default_h5_torch_datasets(
    data=data,
    dataset_path=path,
)

Example 2: load the hdf5 dataset

from h5torch.datasets import H5TorchDataset

path = "../data/dataset.hdf5"

dataset = H5TorchDataset(
    path=path,
)

About

License:GNU General Public License v3.0


Languages

Language:Python 54.9%Language:Makefile 45.1%