From c6fadd1c813b8215f5f62102c8cec417c66746f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Deltheil?= Date: Thu, 7 Sep 2023 18:18:19 +0200 Subject: [PATCH] deprecate bidirectional_mapping util --- src/refiners/fluxion/utils.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/refiners/fluxion/utils.py b/src/refiners/fluxion/utils.py index 2b4fcc9..b0d83c5 100644 --- a/src/refiners/fluxion/utils.py +++ b/src/refiners/fluxion/utils.py @@ -1,4 +1,4 @@ -from typing import Dict, Iterable, Literal, TypeVar +from typing import Iterable, Literal, TypeVar from PIL import Image from numpy import array, float32 from pathlib import Path @@ -34,10 +34,6 @@ def interpolate(x: Tensor, factor: float | torch.Size, mode: str = "nearest") -> ) # type: ignore -def bidirectional_mapping(mapping: Dict[str, str]) -> Dict[str, str]: - return {**mapping, **{value: key for key, value in mapping.items()}} - - def image_to_tensor(image: Image.Image, device: Device | str | None = None, dtype: DType | None = None) -> Tensor: return torch.tensor(array(image).astype(float32).transpose(2, 0, 1) / 255.0, device=device, dtype=dtype).unsqueeze( 0