File tree 3 files changed +16
-8
lines changed
3 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -392,7 +392,7 @@ class ShiftY():
392
392
* x>=0: 100, x<0: -100
393
393
"""
394
394
def __init__ (self , shift_amount_y ):
395
- self .shift_amount_y = int ( shift_amount_y )
395
+ self .shift_amount_y = shift_amount_y
396
396
self .to_mask = True
397
397
self .to_img = True
398
398
@@ -428,7 +428,7 @@ class ShiftX():
428
428
* x>=0: 100, x<0: -100
429
429
"""
430
430
def __init__ (self , shift_amount_x ):
431
- self .shift_amount_x = int ( shift_amount_x )
431
+ self .shift_amount_x = shift_amount_x
432
432
self .to_mask = True
433
433
self .to_img = True
434
434
Original file line number Diff line number Diff line change 25
25
roundup ,
26
26
discrete_angle ,
27
27
discrete_shift ,
28
- discrete_rcrop
28
+ discrete_rcrop ,
29
+ discrete_shear
29
30
)
30
31
31
32
class Trainer ():
@@ -107,13 +108,17 @@ def train(self, **params):
107
108
108
109
if "angle" in params .keys ():
109
110
params ["angle" ] = discrete_angle (params ["angle" ])
110
- if "shift_x" in params .keys ():
111
- params ["shift_x" ] = discrete_shift (params ["shift_x" ])
112
- if "shift_y" in params .keys ():
113
- params ["shift_y" ] = discrete_shift (params ["shift_y" ])
114
-
111
+ if "shift_amount_x" in params .keys ():
112
+ params ["shift_amount_x" ] = discrete_shift (params ["shift_amount_x" ])
113
+ if "shift_amount_y" in params .keys ():
114
+ params ["shift_amount_y" ] = discrete_shift (params ["shift_amount_y" ])
115
115
if "crop_height" in params .keys ():
116
116
params ["crop_height" ] = discrete_rcrop (params ["crop_height" ])
117
+ if "shear_amount_y" in params .keys ():
118
+ params ["shear_amount_y" ] = discrete_shear (params ["shear_amount_y" ])
119
+ if "shear_amount_x" in params .keys ():
120
+ params ["shear_amount_x" ] = discrete_shear (params ["shear_amount_x" ])
121
+
117
122
118
123
if type (self .augmentations ) == Listed :
119
124
transform = self .augmentations (** params )
Original file line number Diff line number Diff line change @@ -18,3 +18,6 @@ def discrete_shift(x):
18
18
19
19
def discrete_rcrop (x ):
20
20
return int (x * 1000 )
21
+
22
+ def discrete_shear (x ):
23
+ return x * 10
You can’t perform that action at this time.
0 commit comments