lkubin commented on a change in pull request #16794: Random rotation
URL: https://github.com/apache/incubator-mxnet/pull/16794#discussion_r370520654
 
 

 ##########
 File path: python/mxnet/gluon/data/vision/transforms.py
 ##########
 @@ -197,6 +199,78 @@ def hybrid_forward(self, F, x):
         return F.image.normalize(x, self._mean, self._std)
 
 
+class Rotate(Block):
+    """Rotate the input image by a given angle. Keeps the original image shape.
+
+    Parameters
+    ----------
+    rotation_degrees : float32
+        Desired rotation angle in degrees, in range (-90, 90).
+    zoom_in : bool
+        Zoom in image so that no padding is present in final output.
+    zoom_out : bool
+        Zoom out image so that the entire original image is present in final 
output.
+
+
+    Inputs:
+        - **data**: input tensor with (C x H x W) or (N x C x H x W) shape.
+
+    Outputs:
+        - **out**: output tensor with (C x H x W) or (N x C x H x W) shape.
+    """
+    def __init__(self, rotation_degrees, zoom_in=False, zoom_out=False):
+        super(Rotate, self).__init__()
+        if (rotation_degrees < -90 or rotation_degrees > 90):
+            raise ValueError("Rotation angle should be between -90 and 90 
degrees")
 
 Review comment:
   With the change that @douglas125 did there is not that kind of problem 
anymore.

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


With regards,
Apache Git Services

Reply via email to