From 23247e122d1b98455e641c31676949ab78dcde4e Mon Sep 17 00:00:00 2001 From: "Kelvin C.K. Chan" Date: Thu, 25 Nov 2021 17:48:41 +0800 Subject: [PATCH] [Fix] Fix bug in MATLABLikeResize (#630) --- mmedit/datasets/pipelines/matlab_like_resize.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmedit/datasets/pipelines/matlab_like_resize.py b/mmedit/datasets/pipelines/matlab_like_resize.py index 5bb845c0c6..b6f63102ad 100644 --- a/mmedit/datasets/pipelines/matlab_like_resize.py +++ b/mmedit/datasets/pipelines/matlab_like_resize.py @@ -62,7 +62,7 @@ def _cubic(x): # if |x| <= 1: y = 1.5|x|^3 - 2.5|x|^2 + 1 # if 1 < |x| <= 2: -0.5|x|^3 + 2.5|x|^2 - 4|x| + 2 - f = 1.5 * (x_abs_cu - 2.5 * x_abs_sq + 1) * (x_abs <= 1) + ( + f = (1.5 * x_abs_cu - 2.5 * x_abs_sq + 1) * (x_abs <= 1) + ( -0.5 * x_abs_cu + 2.5 * x_abs_sq - 4 * x_abs + 2) * ((1 < x_abs) & (x_abs <= 2))