瀏覽代碼

fix data augmentation in pairwise_transform.scale

nagadomi 10 年之前
父節點
當前提交
0d115f46f6
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      lib/pairwise_transform.lua

+ 4 - 4
lib/pairwise_transform.lua

@@ -23,13 +23,13 @@ function pairwise_transform.scale(src, scale, size, offset, options)
    }
    local downscale_filter = filters[torch.random(1, #filters)]
    
-   if r == 1 then
+   if flip == 1 then
       y = image.hflip(y)
-   elseif r == 2 then
+   elseif flip == 2 then
       y = image.vflip(y)
-   elseif r == 3 then
+   elseif flip == 3 then
       y = image.hflip(image.vflip(y))
-   elseif r == 4 then
+   elseif flip == 4 then
       -- none
    end
    if options.color_augment then