Browse Source

fix data augmentation in pairwise_transform.scale

nagadomi 10 years ago
parent
commit
0d115f46f6
1 changed files with 4 additions and 4 deletions
  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