You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by zh...@apache.org on 2018/06/29 02:24:12 UTC

[incubator-mxnet] branch master updated: fix record io augmentation speed (#11474)

This is an automated email from the ASF dual-hosted git repository.

zhasheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
     new b344d89  fix record io augmentation speed (#11474)
b344d89 is described below

commit b344d89a80f87fce01a964347ff0b5f54e62f374
Author: Tong He <he...@gmail.com>
AuthorDate: Thu Jun 28 19:24:00 2018 -0700

    fix record io augmentation speed (#11474)
---
 example/image-classification/common/data.py | 2 +-
 src/io/image_aug_default.cc                 | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/example/image-classification/common/data.py b/example/image-classification/common/data.py
index bfaadb3..c1dfcf5 100755
--- a/example/image-classification/common/data.py
+++ b/example/image-classification/common/data.py
@@ -86,7 +86,7 @@ def add_data_aug_args(parser):
 
 def set_resnet_aug(aug):
     # standard data augmentation setting for resnet training
-    aug.set_defaults(random_crop=1, random_resized_crop=1)
+    aug.set_defaults(random_crop=0, random_resized_crop=1)
     aug.set_defaults(min_random_area=0.08)
     aug.set_defaults(max_random_aspect_ratio=4./3., min_random_aspect_ratio=3./4.)
     aug.set_defaults(brightness=0.4, contrast=0.4, saturation=0.4, pca_noise=0.1)
diff --git a/src/io/image_aug_default.cc b/src/io/image_aug_default.cc
index ce9c79c..5b28aa1 100644
--- a/src/io/image_aug_default.cc
+++ b/src/io/image_aug_default.cc
@@ -293,7 +293,7 @@ class DefaultImageAugmenter : public ImageAugmenter {
     if (param_.max_rotate_angle > 0 || param_.max_shear_ratio > 0.0f
         || param_.rotate > 0 || rotate_list_.size() > 0
         || param_.max_random_scale != 1.0f || param_.min_random_scale != 1.0
-        || min_aspect_ratio != 1.0f || max_aspect_ratio != 1.0f
+        || (!param_.random_resized_crop && (min_aspect_ratio != 1.0f || max_aspect_ratio != 1.0f))
         || param_.max_img_size != 1e10f || param_.min_img_size != 0.0f) {
       std::uniform_real_distribution<float> rand_uniform(0, 1);
       // shear