An abundance of augmentation layers
Project description
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:
- MONAI
- TorchIO
- Albumentations (2D only)
- Volumentations (3D extension of Albumentations)
Contributions
If you find this project useful and wish to contribute, please reach out!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cornucopia-0.3.0.tar.gz
.
File metadata
- Download URL: cornucopia-0.3.0.tar.gz
- Upload date:
- Size: 114.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | af50fabddd9b5d363ad4daa7dfbe5a0bbd2e4a721953814a2d339577f703ee66 |
|
MD5 | 870e7d825ae66bbbd7b7734a8c452f63 |
|
BLAKE2b-256 | 0098a777094c2f890a7f49812cf8682a7d0eb83e4dd0f37202001107b1b3bcf8 |
File details
Details for the file cornucopia-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: cornucopia-0.3.0-py3-none-any.whl
- Upload date:
- Size: 113.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 268eadfdaddbef8e403f0690372f99952707ecf1227f277bb031b07f62ee8bb2 |
|
MD5 | dd562e7ed7f5e4f608ca6558d724e860 |
|
BLAKE2b-256 | ca05ea172797ae4caec245e2e66a090ce63f475d70fab1baf2de4c7c9b288659 |