Skip to content

Commit

Permalink
fix: Fix RandomRotate
Browse files Browse the repository at this point in the history
  • Loading branch information
pierluigiferrari committed Apr 15, 2018
1 parent 65aa583 commit 9f70e79
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions transformations/object_detection_2d_geometric_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class Translate:
def __init__(self,
dy,
dx,
clip_boxes=False,
clip_boxes=True,
box_filter=None,
background=(0,0,0),
labels_format={'class_id': 0, 'xmin': 1, 'ymin': 2, 'xmax': 3, 'ymax': 4}):
Expand Down Expand Up @@ -326,7 +326,7 @@ def __init__(self,
dy_minmax=(0.03,0.3),
dx_minmax=(0.03,0.3),
prob=0.5,
clip_boxes=False,
clip_boxes=True,
box_filter=None,
image_validator=None,
n_trials_max=3,
Expand Down Expand Up @@ -454,7 +454,7 @@ class Scale:

def __init__(self,
factor,
clip_boxes=False,
clip_boxes=True,
box_filter=None,
background=(0,0,0),
labels_format={'class_id': 0, 'xmin': 1, 'ymin': 2, 'xmax': 3, 'ymax': 4}):
Expand Down Expand Up @@ -541,7 +541,7 @@ def __init__(self,
min_factor=0.5,
max_factor=1.5,
prob=0.5,
clip_boxes=False,
clip_boxes=True,
box_filter=None,
image_validator=None,
n_trials_max=3,
Expand Down Expand Up @@ -762,7 +762,7 @@ def __init__(self,
self.angles = angles
self.prob = prob
self.labels_format = labels_format
self.rotate = Rotate(angle=0, labels_format=self.labels_format)
self.rotate = Rotate(angle=90, labels_format=self.labels_format)

def __call__(self, image, labels=None):

Expand All @@ -771,7 +771,7 @@ def __call__(self, image, labels=None):
# Pick a rotation angle.
self.rotate.angle = random.choice(self.angles)
self.rotate.labels_format = self.labels_format
return rotate(image, labels)
return self.rotate(image, labels)

elif labels is None:
return image
Expand Down

0 comments on commit 9f70e79

Please sign in to comment.