def _load_metadata(path: str | Path | dict | None = None) -> dict | DictConfig:
        """Load metadata from a file.

        Args:
            path (str | Path | dict | None): Path to metadata file. If None,
                returns empty dict. Defaults to None.

        Returns:
            dict | DictConfig: Loaded metadata.

        Example:
            >>> model = Inferencer()  # doctest: +SKIP
            >>> metadata = model._load_metadata("path/to/metadata.json")
            ... # doctest: +SKIP
        """
        metadata: dict[str, float | np.ndarray | torch.Tensor] | DictConfig = {}
        if path is not None:
            config = OmegaConf.load(path)
            metadata = cast(DictConfig, config)
        return metadata
Load metadata from a file.

        Args:
            path (str | Path | dict | None): Path to metadata file. If None,
                returns empty dict. Defaults to None.

        Returns:
            dict | DictConfig: Loaded metadata.

        Example:
            >>> model = Inferencer()  # doctest: +SKIP
            >>> metadata = model._load_metadata("path/to/metadata.json")
            ... # doctest: +SKIP
        
src/anomalib/deploy/inferencers/base_inferencer.py