π Geometric Computer Vision Library for Spatial AI
Python artificial-intelligencecomputer-visiondeep-learninghacktoberfestimage-processingmachine-learningneural-networkpythonpytorchroboticsspatial-ai
Fix blocking operation in hsv_to_rgb (#3221)
astrobdr6a85a37d494e
diff --git a/kornia/color/hsv.py b/kornia/color/hsv.pyindex 6bca3dacb..b2e617863 100644--- a/kornia/color/hsv.py+++ b/kornia/color/hsv.py@@ -104,10 +104,9 @@ def hsv_to_rgb(image: torch.Tensor) -> torch.Tensor:hi: torch.Tensor = torch.floor(h * 6) % 6f: torch.Tensor = ((h * 6) % 6) - hi- one: torch.Tensor = torch.tensor(1.0, device=image.device, dtype=image.dtype)- p: torch.Tensor = v * (one - s)- q: torch.Tensor = v * (one - f * s)- t: torch.Tensor = v * (one - (one - f) * s)+ p: torch.Tensor = v * (1.0 - s)+ q: torch.Tensor = v * (1.0 - f * s)+ t: torch.Tensor = v * (1.0 - (1.0 - f) * s)hi = hi.long()indices: torch.Tensor = torch.stack([hi, hi + 6, hi + 12], dim=-3)