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.0.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.0-py3-none-any.whl (166.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cornucopia-0.5.0.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.0.tar.gz
Algorithm Hash digest
SHA256 56a51d0950682ecf3c2cb952160b094d9834f74cf40713ed7227164586ad7f96
MD5 81cef851bff9380748f711bef8057313
BLAKE2b-256 1cf10c8d77e41dc8fc733569f5b813b34c282b7c75d3716d5b002ebf788fe08c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cornucopia-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 166.8 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3ab30ded8005208d47b2eb286149e3e4e01b28f3462f73d08354b7871409ece3
MD5 24055d397ec05e395d578969a5232dd7
BLAKE2b-256 afb7f14ace9ccd1485a0f24135523b3d7e54a8bb00e66efd9523eb56d453898d

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