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

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.5.1.tar.gz (143.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cornucopia-0.5.1-py3-none-any.whl (166.7 kB view details)

Uploaded Python 3

File details

Details for the file cornucopia-0.5.1.tar.gz.

File metadata

  • Download URL: cornucopia-0.5.1.tar.gz
  • Upload date:
  • Size: 143.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cornucopia-0.5.1.tar.gz
Algorithm Hash digest
SHA256 ce3394515139282a4c62bf06b022973ea19d7b864d5cdd923c424ec0525b443b
MD5 815bb7167346f03acddc7643b1ae6a04
BLAKE2b-256 fbdda849af26ba217009bada4a6d1fcf7bd7fd2724207195e418d2628e44e200

See more details on using hashes here.

File details

Details for the file cornucopia-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: cornucopia-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 166.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cornucopia-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6491250a3ae11a1da25d25bbd80fd91d7fb27026fba312daca055cb1611d04a3
MD5 2373aea5b123b4024052c05501a8cee0
BLAKE2b-256 43a0e7d64cb4d9659703daebabf2bd27e91662286fee23962c06a21ea20ba070

See more details on using hashes here.

Supported by

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