@@ -228,10 +228,10 @@ def _build_transform_train(cfg, choices, target_size, normalize):
228
228
tfm_train += [RandomCrop (input_size , padding = crop_padding )]
229
229
230
230
if "random_resized_crop" in choices :
231
- print ( f"+ random resized crop (size= { input_size } )" )
232
- s = cfg . INPUT . RRCROP_SCALE
231
+ s_ = cfg . INPUT . RRCROP_SCALE
232
+ print ( f"+ random resized crop (size= { input_size } , scale= { s_ } )" )
233
233
tfm_train += [
234
- RandomResizedCrop (input_size , scale = s , interpolation = interp_mode )
234
+ RandomResizedCrop (input_size , scale = s_ , interpolation = interp_mode )
235
235
]
236
236
237
237
if "random_flip" in choices :
@@ -267,13 +267,20 @@ def _build_transform_train(cfg, choices, target_size, normalize):
267
267
tfm_train += [RandAugment2 (n_ )]
268
268
269
269
if "colorjitter" in choices :
270
- print ("+ color jitter" )
270
+ b_ = cfg .INPUT .COLORJITTER_B
271
+ c_ = cfg .INPUT .COLORJITTER_C
272
+ s_ = cfg .INPUT .COLORJITTER_S
273
+ h_ = cfg .INPUT .COLORJITTER_H
274
+ print (
275
+ f"+ color jitter (brightness={ b_ } , "
276
+ f"contrast={ c_ } , saturation={ s_ } , hue={ h_ } )"
277
+ )
271
278
tfm_train += [
272
279
ColorJitter (
273
- brightness = cfg . INPUT . COLORJITTER_B ,
274
- contrast = cfg . INPUT . COLORJITTER_C ,
275
- saturation = cfg . INPUT . COLORJITTER_S ,
276
- hue = cfg . INPUT . COLORJITTER_H ,
280
+ brightness = b_ ,
281
+ contrast = c_ ,
282
+ saturation = s_ ,
283
+ hue = h_ ,
277
284
)
278
285
]
279
286
0 commit comments