albumentations.core.hub_mixin
This module provides mixin functionality for the Albumentations library. It includes utility functions and classes to enhance the core capabilities.
Members
- functionrequire_huggingface_hub
- classHubMixin
require_huggingface_hubfunction
require_huggingface_hub(
func: Callable[..., Any]
)Decorator to require huggingface_hub. This decorator ensures that the `huggingface_hub` package is installed before executing the decorated function. If the package is not installed, it raises an ImportError with instructions on how to install it. Args: func (Callable[..., Any]): The function to decorate. Returns: Callable[..., Any]: The decorated function.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| func | Callable[..., Any] | - | - |
HubMixinclass
HubMixin()Mixin class for Hugging Face Hub integration. This class provides functionality for saving and loading transforms to/from the Hugging Face Hub. It enables serialization, deserialization, and sharing of transform configurations. Args: _CONFIG_KEYS (tuple[str, ...]): Keys used for configuration files. _CONFIG_FILE_NAME_TEMPLATE (str): Template for configuration filenames.