Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

Fixed type error for lab_to_rgb conversion when using coremltools. (#1002)

Ahmet Serdar Karadeniz22e2297a0af2
diff --git a/kornia/color/lab.py b/kornia/color/lab.py
index 91a698f7a..1d4ab9ed6 100644
--- a/kornia/color/lab.py
+++ b/kornia/color/lab.py
@@ -97,7 +97,7 @@ def lab_to_rgb(image: torch.Tensor, clip: bool = True) -> torch.Tensor:
fz = fy - (_b / 200.)
# if color data out of range: Z < 0
- fz = fz.clamp(min=0)
+ fz = fz.clamp(min=0.)
fxyz = torch.stack([fx, fy, fz], dim=-3)