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 Provenance
BetterLoader-0.2.2.tar.gz 12.3 kB Without provenance 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

Security for BetterLoader 0.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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