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.4.0.tar.gz (124.2 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.4.0-py3-none-any.whl (126.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for cornucopia-0.4.0.tar.gz
Algorithm Hash digest
SHA256 372880a00e30e13cbdcfbc267b4d150a8391e9a72a045a8562794dcfe1bcfd0c
MD5 cfdfbcd824144cf70f2a1e315a1825dc
BLAKE2b-256 746ddfaffebe71d9d9c100162302f2554efd63a59643d77f70b0741a54e2d8a7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cornucopia-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 126.2 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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5cb2ee780a521aa1084c9772c82b2395b02a3350aeb9092dfcf54f80477de0e7
MD5 af68a8425b4869fafe038328cf51a665
BLAKE2b-256 3f6b938c9c5339dba555f518b572a059acd20d45b985f32fda3af9f61c31f1ec

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