[GitHub] piiswrong commented on a change in pull request #10825: Adding max_area to random_size_crop

2018-05-08 Thread GitBox
piiswrong commented on a change in pull request #10825: Adding max_area to 
random_size_crop
URL: https://github.com/apache/incubator-mxnet/pull/10825#discussion_r186794091
 
 

 ##
 File path: python/mxnet/image/image.py
 ##
 @@ -457,9 +459,15 @@ def random_size_crop(src, size, min_area, ratio, 
interp=2):
 
 """
 h, w, _ = src.shape
-area = h * w
+src_area = h * w
+
+if 'min_area' in kwargs:
+warnings.warn('`min_area` is deprecated. Please use `area` instead.', 
DeprecationWarning)
+area = kwargs.get('min_area')
 
 Review comment:
   ```
   if 'min_area' in kwargs:
   warnings.warn('`min_area` is deprecated. Please use `area` 
instead.', DeprecationWarning)
   area = kwargs.pop('min_area')
   assert not kwargs, "unexpected keyword arguments ..."
   ```


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong commented on a change in pull request #10825: Adding max_area to random_size_crop

2018-05-05 Thread GitBox
piiswrong commented on a change in pull request #10825: Adding max_area to 
random_size_crop
URL: https://github.com/apache/incubator-mxnet/pull/10825#discussion_r186279995
 
 

 ##
 File path: docs/tutorials/python/types_of_data_augmentation.md
 ##
 @@ -302,7 +302,7 @@ Some shortcut functions are provided to perform multiple 
augmentation in a singl
 ```python
 # A random crop, with a random resizing, and random aspect ratio jitter
 example_image_copy = example_image.copy()
-aug = mx.image.RandomSizedCropAug(size=(100, 100), min_area=0.1, ratio=(1.0, 
1.5))
+aug = mx.image.RandomSizedCropAug(size=(100, 100), area=0.1, ratio=(1.0, 1.5))
 
 Review comment:
   no. somehting like xx is deprecated and renamed to xxx


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong commented on a change in pull request #10825: Adding max_area to random_size_crop

2018-05-05 Thread GitBox
piiswrong commented on a change in pull request #10825: Adding max_area to 
random_size_crop
URL: https://github.com/apache/incubator-mxnet/pull/10825#discussion_r186278723
 
 

 ##
 File path: docs/tutorials/python/types_of_data_augmentation.md
 ##
 @@ -302,7 +302,7 @@ Some shortcut functions are provided to perform multiple 
augmentation in a singl
 ```python
 # A random crop, with a random resizing, and random aspect ratio jitter
 example_image_copy = example_image.copy()
-aug = mx.image.RandomSizedCropAug(size=(100, 100), min_area=0.1, ratio=(1.0, 
1.5))
+aug = mx.image.RandomSizedCropAug(size=(100, 100), area=0.1, ratio=(1.0, 1.5))
 
 Review comment:
   So looks like people are already using min_area as keyword argument.
   We should keep backward compatibility by adding **kwargs to 
RandomSizedCropAug  and random_size_crop and check if min_area is present, then 
issue a warning and override area


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong commented on a change in pull request #10825: Adding max_area to random_size_crop

2018-05-05 Thread GitBox
piiswrong commented on a change in pull request #10825: Adding max_area to 
random_size_crop
URL: https://github.com/apache/incubator-mxnet/pull/10825#discussion_r186278723
 
 

 ##
 File path: docs/tutorials/python/types_of_data_augmentation.md
 ##
 @@ -302,7 +302,7 @@ Some shortcut functions are provided to perform multiple 
augmentation in a singl
 ```python
 # A random crop, with a random resizing, and random aspect ratio jitter
 example_image_copy = example_image.copy()
-aug = mx.image.RandomSizedCropAug(size=(100, 100), min_area=0.1, ratio=(1.0, 
1.5))
+aug = mx.image.RandomSizedCropAug(size=(100, 100), area=0.1, ratio=(1.0, 1.5))
 
 Review comment:
   So looks like people are already using min_area as keyword argument.
   We should keep backward compatibility by adding **kwargs to random_size_crop 
and check if min_area is present, then issue a warning and override area


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong commented on a change in pull request #10825: Adding max_area to random_size_crop

2018-05-05 Thread GitBox
piiswrong commented on a change in pull request #10825: Adding max_area to 
random_size_crop
URL: https://github.com/apache/incubator-mxnet/pull/10825#discussion_r186278723
 
 

 ##
 File path: docs/tutorials/python/types_of_data_augmentation.md
 ##
 @@ -302,7 +302,7 @@ Some shortcut functions are provided to perform multiple 
augmentation in a singl
 ```python
 # A random crop, with a random resizing, and random aspect ratio jitter
 example_image_copy = example_image.copy()
-aug = mx.image.RandomSizedCropAug(size=(100, 100), min_area=0.1, ratio=(1.0, 
1.5))
+aug = mx.image.RandomSizedCropAug(size=(100, 100), area=0.1, ratio=(1.0, 1.5))
 
 Review comment:
   So looks like people are already using min_area as keyword argument.
   We should keep backward compatibility by adding **kwargs to 
RandomSizedCropAug and random_size_crop and check if min_area is present, then 
issue a warning and override area


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong commented on a change in pull request #10825: Adding max_area to random_size_crop

2018-05-05 Thread GitBox
piiswrong commented on a change in pull request #10825: Adding max_area to 
random_size_crop
URL: https://github.com/apache/incubator-mxnet/pull/10825#discussion_r186276997
 
 

 ##
 File path: python/mxnet/image/image.py
 ##
 @@ -596,7 +600,7 @@ class RandomSizedCropAug(Augmenter):
 --
 size : tuple of (int, int)
 Size of the crop formatted as (width, height).
-min_area : int
+min_area : float in (0, 1]
 
 Review comment:
   this doc and argument name needs to be changed too?


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong commented on a change in pull request #10825: Adding max_area to random_size_crop

2018-05-05 Thread GitBox
piiswrong commented on a change in pull request #10825: Adding max_area to 
random_size_crop
URL: https://github.com/apache/incubator-mxnet/pull/10825#discussion_r186276984
 
 

 ##
 File path: python/mxnet/image/image.py
 ##
 @@ -457,9 +458,12 @@ def random_size_crop(src, size, min_area, ratio, 
interp=2):
 
 """
 h, w, _ = src.shape
-area = h * w
+src_area = h * w
+if isinstance(area, float):
 
 Review comment:
   check for base.numeric_types


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:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] piiswrong commented on a change in pull request #10825: Adding max_area to random_size_crop

2018-05-05 Thread GitBox
piiswrong commented on a change in pull request #10825: Adding max_area to 
random_size_crop
URL: https://github.com/apache/incubator-mxnet/pull/10825#discussion_r186276983
 
 

 ##
 File path: python/mxnet/image/image.py
 ##
 @@ -457,9 +458,12 @@ def random_size_crop(src, size, min_area, ratio, 
interp=2):
 
 """
 h, w, _ = src.shape
-area = h * w
+src_area = h * w
+if isinstance(area, float):
+area = max(min(area, 1.0), 0.0)
 
 Review comment:
   no need for this.


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:
us...@infra.apache.org


With regards,
Apache Git Services