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

[GitHub] szha closed pull request #11474: Fix record io augmentation speed

szha closed pull request #11474: Fix record io augmentation speed
URL: https://github.com/apache/incubator-mxnet/pull/11474
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/example/image-classification/common/data.py b/example/image-classification/common/data.py
index bfaadb3ff6b..c1dfcf56546 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 ce9c79c403a..5b28aa18913 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


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services