@@ -225,7 +225,7 @@ def _build_transform_train(cfg, choices, target_size, normalize):
225
225
226
226
if "random_crop" in choices :
227
227
crop_padding = cfg .INPUT .CROP_PADDING
228
- print ("+ random crop (padding = {})" . format ( crop_padding ) )
228
+ print (f "+ random crop (padding = { crop_padding } )" )
229
229
tfm_train += [RandomCrop (cfg .INPUT .SIZE , padding = crop_padding )]
230
230
231
231
if "random_resized_crop" in choices :
@@ -253,17 +253,17 @@ def _build_transform_train(cfg, choices, target_size, normalize):
253
253
if "randaugment" in choices :
254
254
n_ = cfg .INPUT .RANDAUGMENT_N
255
255
m_ = cfg .INPUT .RANDAUGMENT_M
256
- print ("+ randaugment (n={}, m={})" . format ( n_ , m_ ) )
256
+ print (f "+ randaugment (n={ n_ } , m={ m_ } )" )
257
257
tfm_train += [RandAugment (n_ , m_ )]
258
258
259
259
if "randaugment_fixmatch" in choices :
260
260
n_ = cfg .INPUT .RANDAUGMENT_N
261
- print ("+ randaugment_fixmatch (n={})" . format ( n_ ) )
261
+ print (f "+ randaugment_fixmatch (n={ n_ } )" )
262
262
tfm_train += [RandAugmentFixMatch (n_ )]
263
263
264
264
if "randaugment2" in choices :
265
265
n_ = cfg .INPUT .RANDAUGMENT_N
266
- print ("+ randaugment2 (n={})" . format ( n_ ) )
266
+ print (f "+ randaugment2 (n={ n_ } )" )
267
267
tfm_train += [RandAugment2 (n_ )]
268
268
269
269
if "colorjitter" in choices :
@@ -293,21 +293,18 @@ def _build_transform_train(cfg, choices, target_size, normalize):
293
293
if "cutout" in choices :
294
294
cutout_n = cfg .INPUT .CUTOUT_N
295
295
cutout_len = cfg .INPUT .CUTOUT_LEN
296
- print ("+ cutout (n_holes={}, length={})" . format ( cutout_n , cutout_len ) )
296
+ print (f "+ cutout (n_holes={ cutout_n } , length={ cutout_len } )" )
297
297
tfm_train += [Cutout (cutout_n , cutout_len )]
298
298
299
299
if "normalize" in choices :
300
300
print (
301
- "+ normalization (mean={}, "
302
- "std={})" .format (cfg .INPUT .PIXEL_MEAN , cfg .INPUT .PIXEL_STD )
301
+ f"+ normalization (mean={ cfg .INPUT .PIXEL_MEAN } , std={ cfg .INPUT .PIXEL_STD } )"
303
302
)
304
303
tfm_train += [normalize ]
305
304
306
305
if "gaussian_noise" in choices :
307
306
print (
308
- "+ gaussian noise (mean={}, std={})" .format (
309
- cfg .INPUT .GN_MEAN , cfg .INPUT .GN_STD
310
- )
307
+ f"+ gaussian noise (mean={ cfg .INPUT .GN_MEAN } , std={ cfg .INPUT .GN_STD } )"
311
308
)
312
309
tfm_train += [GaussianNoise (cfg .INPUT .GN_MEAN , cfg .INPUT .GN_STD )]
313
310
@@ -337,8 +334,7 @@ def _build_transform_test(cfg, choices, target_size, normalize):
337
334
338
335
if "normalize" in choices :
339
336
print (
340
- "+ normalization (mean={}, "
341
- "std={})" .format (cfg .INPUT .PIXEL_MEAN , cfg .INPUT .PIXEL_STD )
337
+ f"+ normalization (mean={ cfg .INPUT .PIXEL_MEAN } , std={ cfg .INPUT .PIXEL_STD } )"
342
338
)
343
339
tfm_test += [normalize ]
344
340
0 commit comments