Skip to content
This repository has been archived by the owner on Jul 2, 2021. It is now read-only.

deprecate random_rotate #693

Merged
merged 1 commit into from
Sep 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
deprecate random_rotate
  • Loading branch information
yuyu2172 committed Sep 13, 2018
commit b8da060cf24a138cbe0428f58a218b1a2fdeb18f
5 changes: 5 additions & 0 deletions chainercv/transforms/image/random_rotate.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import numpy as np
import warnings


def random_rotate(img, return_param=False):
Expand All @@ -25,6 +26,10 @@ def random_rotate(img, return_param=False):
times the image is rotated by 90 degrees.

"""
warnings.warn(
'chainercv.transforms.random_rotate is deprecated. '
'Please use a random function and chainercv.transforms.rotate '
'instead.', DeprecationWarning)
k = np.random.randint(4)
img = np.transpose(img, axes=(1, 2, 0))
img = np.rot90(img, k)
Expand Down