Skip to content

Adding only 90 degrees rotations to augmentations #5994

Answered by glenn-jocher
ivankovd asked this question in Q&A
Discussion options

You must be logged in to vote

@ivankovd you can simply uncomment L145 here to allow discrete random 90deg rotations:

# Rotation and Scale
R = np.eye(3)
a = random.uniform(-degrees, degrees)
# a += random.choice([-180, -90, 0, 90]) # add 90deg rotations to small rotations
s = random.uniform(1 - scale, 1 + scale)
# s = 2 ** random.uniform(-scale, scale)
R[:2] = cv2.getRotationMatrix2D(angle=a, center=(0, 0), scale=s)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ivankovd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants