Skip to main content

Making it harder to do easy things, but easier to do harder things with the Pytorch Dataloader


About • Installation • Usage • Development • License

PyPi Badge PyPi Version Github Actions Build Status Issues license


About BetterLoader

BetterLoader is a hyper-customizable extension of the default PyTorch dataloader class, that allows for custom transformations pre-load and image subset definitions. Use the power of custom index files to maintain only a single copy of a dataset with a fixed, flat file structure, and allow BetterLoader to do all the heavy lifting.

Installation

pip install betterloader

Usage

BetterLoader allows you to dynamically assign images to labels, load subsets of images conditionally, perform custom pretransforms before loading an image, and much more.

Basic Usage

A few points worth noting are that:

  • BetterLoader does not expect a nested folder structure. In its current iteration, files are expected to all be present in the root directory.
  • Every instance of BetterLoader requires an index file to function. Sample index files may be found here.
from betterloader import BetterLoader

index_json = './examples/sample_index.json'
basepath = "./examples/sample_dataset/"
batch_size = 2

loader = BetterLoader(basepath=basepath, index_json_path=index_json)
dataloaders, sizes = loader.fetch_segmented_dataloaders(batch_size=batch_size, transform=None)

print("Dataloader sizes: {}".format(str(sizes)))

For more information and more detailed examples, please check out the BetterLoader docs!

Development

We use Makefile to make our lives a little easier :)

Install Dependancies

make install

Run Sample

make sample

Run Unit Tests

make test

Meta

Distributed under the MIT license. See LICENSE for more information.

Documentation & Usage

Metadata

Release files for BetterLoader 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for BetterLoader 0.2.2
File Size Uploaded
BetterLoader-0.2.2.tar.gz 12.3 kB Details

Release files / BetterLoader-0.2.2.tar.gz

Download URL BetterLoader-0.2.2.tar.gz
Size 12.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2c61a5877bf9a300a8dd6aee73e89191f4a064d9912e4a32319a8feefebc8303
BLAKE2b-256 checksum
How to use checksums
bfc3eceb08cb4a7bf7d56709e4d5bc0c323ef789aebff7494dc8fa5a2251583c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.3

Release history Release notifications | RSS feed

This release

0.2.2 This release

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.9

1 release file

0.1.8

1 release file

0.1.7

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page