소스 검색

Change downsampling filters in pairwise_scale()

nagadomi 8 년 전
부모
커밋
ed12b43477
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      lib/data_augmentation.lua

+ 3 - 1
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