From ed12b43477b232f85214fe91ed8eb9c6555d2204 Mon Sep 17 00:00:00 2001 From: nagadomi Date: Sun, 26 Feb 2017 09:01:26 +0900 Subject: [PATCH] Change downsampling filters in pairwise_scale() --- lib/data_augmentation.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/data_augmentation.lua b/lib/data_augmentation.lua index 0e75d6c..7bdb93e 100644 --- a/lib/data_augmentation.lua +++ b/lib/data_augmentation.lua @@ -102,7 +102,9 @@ function data_augmentation.pairwise_scale(x, y, p, scale_min, scale_max) local scale = torch.uniform(scale_min, scale_max) local h = math.floor(x:size(2) * scale) local w = math.floor(x:size(3) * scale) - x = iproc.scale(x, w, h, "Triangle") + local filters = {"Lanczos", "Catrom"} + local x_filter = filters[torch.random(1, 2)] + x = iproc.scale(x, w, h, x_filter) y = iproc.scale(y, w, h, "Triangle") return x, y else