Skip to main content

An abundance of augmentation layers

Project description

Cornucopia logo

The cornucopia package provides a generic framework for preprocessing, augmentation, and domain randomization; along with an abundance of specific layers, mostly targeted at (medical) imaging. cornucopia is written using a PyTorch backend, and therefore runs on the CPU or GPU.

Cornucopia is intended to be used on the GPU for on-line augmentation. A quick benchmark of affine and elastic augmentation shows that while cornucopia is slower than TorchIO on the CPU (~ 3s vs 1s), it is greatly accelerated on the GPU (~ 50ms).

Since gradients are not expected to backpropagate through its layers, it can theoretically be used within any dataloader pipeline, independent of the downstream learning framework (pytorch, tensorflow, jax, ...).

Installation

Dependencies

  • pytorch >= 1.8
  • numpy
  • nibabel
  • torch-interpol
  • torch-distmap

Conda

conda install cornucopia -c balbasty -c pytorch -c conda-forge

Pip (release)

pip install cornucopia

Pip (dev)

pip install cornucopia@git+https://github.com/balbasty/cornucopia

Documentation

Read the documentation and in particular:

Other augmentation packages

There are other great, and much more mature, augmentation packages out-there (although few run on the GPU). Here's a non-exhaustive list:

Contributions

If you find this project useful and wish to contribute, please reach out!

Project details


Download files

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

Source Distribution

cornucopia-0.3.0.tar.gz (114.2 kB view hashes)

Uploaded Source

Built Distribution

cornucopia-0.3.0-py3-none-any.whl (113.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page