https://github.com/albumentations-team/albucore
A high-performance image processing library designed to optimize and extend the Albumentations library with specialized functions for advanced image transformations. Perfect for developers working in computer vision who require efficient and scalable image augmentation.
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.2%) to scientific vocabulary
Keywords
Repository
A high-performance image processing library designed to optimize and extend the Albumentations library with specialized functions for advanced image transformations. Perfect for developers working in computer vision who require efficient and scalable image augmentation.
Basic Info
Statistics
- Stars: 20
- Watchers: 5
- Forks: 7
- Open Issues: 0
- Releases: 23
Topics
Metadata Files
README.md
Albucore: High-Performance Image Processing Functions
Albucore is a library of optimized atomic functions designed for efficient image processing. These functions serve as the foundation for AlbumentationsX, a popular image augmentation library.
Overview
Image processing operations can be implemented in various ways, each with its own performance characteristics depending on the image type, size, and number of channels. Albucore aims to provide the fastest implementation for each operation by leveraging different backends such as NumPy, OpenCV, and custom optimized code.
Key features:
- Optimized atomic image processing functions
- Automatic selection of the fastest implementation based on input image characteristics
- Seamless integration with Albumentations
- Extensive benchmarking for performance validation
GitAds Sponsored
Installation
bash
pip install albucore
Usage
```python import numpy as np import albucore
Create a sample RGB image
image = np.random.randint(0, 256, (100, 100, 3), dtype=np.uint8)
Apply a function
result = albucore.multiply(image, 1.5)
For grayscale images, ensure the channel dimension is present
grayimage = np.random.randint(0, 256, (100, 100, 1), dtype=np.uint8) grayresult = albucore.multiply(gray_image, 1.5) ```
Albucore automatically selects the most efficient implementation based on the input image type and characteristics.
Shape Conventions
Albucore expects images to follow specific shape conventions, with the channel dimension always present:
- Single image:
(H, W, C)- Height, Width, Channels - Grayscale image:
(H, W, 1)- Height, Width, 1 channel - Batch of images:
(N, H, W, C)- Number of images, Height, Width, Channels - 3D volume:
(D, H, W, C)- Depth, Height, Width, Channels - Batch of volumes:
(N, D, H, W, C)- Number of volumes, Depth, Height, Width, Channels
Important Notes:
- Channel dimension is always required, even for grayscale images (use shape
(H, W, 1)) - Single-channel images should have shape
(H, W, 1)not(H, W) - Batches and volumes are treated uniformly - a 4D array
(N, H, W, C)can represent either a batch of images or a 3D volume
Examples:
```python import numpy as np import albucore
Grayscale image - MUST have explicit channel dimension
gray_image = np.random.randint(0, 256, (100, 100, 1), dtype=np.uint8)
RGB image
rgb_image = np.random.randint(0, 256, (100, 100, 3), dtype=np.uint8)
Batch of 10 grayscale images
batch_gray = np.random.randint(0, 256, (10, 100, 100, 1), dtype=np.uint8)
3D volume with 20 slices
volume = np.random.randint(0, 256, (20, 100, 100, 1), dtype=np.uint8)
Batch of 5 RGB volumes, each with 20 slices
batch_volumes = np.random.randint(0, 256, (5, 20, 100, 100, 3), dtype=np.uint8) ```
Functions
Albucore includes optimized implementations for various image processing operations, including:
- Arithmetic operations (add, multiply, power)
- Normalization (per-channel, global)
- Geometric transformations (vertical flip, horizontal flip)
- Helper decorators (tofloat, touint8)
Batch Processing
Many functions in Albucore support batch processing out of the box. The library automatically handles different input shapes:
- Single images:
(H, W, C) - Batches:
(N, H, W, C) - Volumes:
(D, H, W, C) - Batch of volumes:
(N, D, H, W, C)
Functions will preserve the input shape structure, applying operations efficiently across all images/slices in the batch.
Decorators
Albucore provides several useful decorators:
@preserve_channel_dim: Ensures single-channel images maintain their shape(H, W, 1)when OpenCV operations might drop the channel dimension@contiguous: Ensures arrays are C-contiguous for optimal performance@uint8_ioand@float32_io: Handle automatic type conversions for functions that work best with specific data types
Performance
Albucore uses a combination of techniques to achieve high performance:
- Multiple Implementations: Each function may have several implementations using different backends (NumPy, OpenCV, custom code).
- Automatic Selection: The library automatically chooses the fastest implementation based on the input image type, size, and number of channels.
- Optimized Algorithms: Custom implementations are optimized for specific use cases, often outperforming general-purpose libraries.
License
MIT
Acknowledgements
Albucore is part of the AlbumentationsX project. We'd like to thank all contributors to AlbumentationsX and the broader computer vision community for their inspiration and support.
Owner
- Name: Albumentations.AI
- Login: albumentations-team
- Kind: organization
- Location: United States of America
- Website: https://albumentations.ai/
- Twitter: albumentations
- Repositories: 12
- Profile: https://github.com/albumentations-team
Fast and flexible image augmentation library for computer vision tasks. Albumentations helps researchers improve models with diverse training data.
GitHub Events
Total
- Create event: 34
- Issues event: 4
- Release event: 13
- Watch event: 10
- Delete event: 22
- Issue comment event: 42
- Push event: 44
- Pull request review event: 48
- Pull request event: 42
- Pull request review comment event: 90
- Fork event: 5
Last Year
- Create event: 34
- Issues event: 4
- Release event: 13
- Watch event: 10
- Delete event: 22
- Issue comment event: 42
- Push event: 44
- Pull request review event: 48
- Pull request event: 42
- Pull request review comment event: 90
- Fork event: 5
Committers
Last synced: 8 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Vladimir Iglovikov | t****s | 38 |
| Tanya Karvat | 3****a | 3 |
| Andrei Yasyrev | 4****v | 3 |
| Robert Schütz | g****b@d****e | 1 |
| Daniel Bershatsky | d****l | 1 |
| Martins Bruveris | m****s@g****t | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 8 months ago
All Time
- Total issues: 10
- Total pull requests: 46
- Average time to close issues: 15 days
- Average time to close pull requests: about 13 hours
- Total issue authors: 7
- Total pull request authors: 7
- Average comments per issue: 2.2
- Average comments per pull request: 1.5
- Merged pull requests: 45
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 8
- Pull requests: 31
- Average time to close issues: 18 days
- Average time to close pull requests: about 14 hours
- Issue authors: 7
- Pull request authors: 7
- Average comments per issue: 2.63
- Average comments per pull request: 1.74
- Merged pull requests: 30
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- ternaus (5)
- W1ls0nG0 (1)
- hmaarrfk (1)
- armanivers (1)
- yurivict (1)
- rakhil575 (1)
- bcdarwin (1)
Pull Request Authors
- ternaus (67)
- trylinka (6)
- ayasyrev (6)
- dotlambda (2)
- martinsbruveris (2)
- ashvardanian (2)
- daskol (1)