Albucore is a high-performance Python library offering optimized atomic functions for image processing in deep learning and computer vision. It serves as a foundational component for the AlbumentationsX library, automatically selecting the fastest implementation for operations using backends like NumPy and OpenCV. Currently at version 0.1.5, the library is actively maintained with frequent updates and performance enhancements.
pip install albucoreVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to import and use a basic image processing function (`multiply` and `add`) from Albucore. It highlights the crucial image shape convention by providing examples for both RGB and grayscale images, ensuring the channel dimension is always present.
Always reshape grayscale images to `(H, W, 1)` using `np.expand_dims(image, axis=-1)` or ensure they are created with this shape. For batches, ensure shapes like `(N, H, W, C)`.
Ensure input images are converted to `np.uint8` or `np.float32` before passing them to Albucore functions. For float images, normalize pixel values to the expected range (e.g., [0, 1] or [0, 255]) as appropriate for the operation.