π Geometric Computer Vision Library for Spatial AI
Python artificial-intelligencecomputer-visiondeep-learninghacktoberfestimage-processingmachine-learningneural-networkpythonpytorchroboticsspatial-ai
:ghost: tuple to list to make pytorch 1.6 happy (#1390)
Edgar Riba0dcb1d9ffda8
diff --git a/kornia/color/raw.py b/kornia/color/raw.pyindex ba8983d9c..a55a98de9 100644--- a/kornia/color/raw.py+++ b/kornia/color/raw.py@@ -117,11 +117,11 @@ def raw_to_rgb(image: torch.Tensor, cfa: CFA) -> torch.Tensor:# evenly spaced between them while the B/R samples will be missing in the corners were they are assumed to exist# Further we need to do align_corners to start the interpolation from the middle of the samples in the corners, that# way we get to keep the known blue samples across the whole image- rpadded = torch.nn.functional.pad(r, rpad, 'replicate')- bpadded = torch.nn.functional.pad(b, bpad, 'replicate')+ rpadded = torch.nn.functional.pad(r, list(rpad), 'replicate')+ bpadded = torch.nn.functional.pad(b, list(bpad), 'replicate')# use explicit padding instead of conv2d padding to be able to use reflect which mirror the correct colors# for a 2x2 bayer filter- gpadded = torch.nn.functional.pad(image, (1, 1, 1, 1), 'reflect')+ gpadded = torch.nn.functional.pad(image, [1, 1, 1, 1], 'reflect')ru = torch.nn.functional.interpolate(rpadded, size=(image.shape[-2] + 1, image.shape[-1] + 1),mode='bilinear', align_corners=True)