Skip to content

Commit 1c619b5

Browse files
committed
remove .format & linting code
1 parent bb8a044 commit 1c619b5

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

dassl/data/transforms/transforms.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def _build_transform_train(cfg, choices, target_size, normalize):
225225

226226
if "random_crop" in choices:
227227
crop_padding = cfg.INPUT.CROP_PADDING
228-
print("+ random crop (padding = {})".format(crop_padding))
228+
print(f"+ random crop (padding = {crop_padding})")
229229
tfm_train += [RandomCrop(cfg.INPUT.SIZE, padding=crop_padding)]
230230

231231
if "random_resized_crop" in choices:
@@ -253,17 +253,17 @@ def _build_transform_train(cfg, choices, target_size, normalize):
253253
if "randaugment" in choices:
254254
n_ = cfg.INPUT.RANDAUGMENT_N
255255
m_ = cfg.INPUT.RANDAUGMENT_M
256-
print("+ randaugment (n={}, m={})".format(n_, m_))
256+
print(f"+ randaugment (n={n_}, m={m_})")
257257
tfm_train += [RandAugment(n_, m_)]
258258

259259
if "randaugment_fixmatch" in choices:
260260
n_ = cfg.INPUT.RANDAUGMENT_N
261-
print("+ randaugment_fixmatch (n={})".format(n_))
261+
print(f"+ randaugment_fixmatch (n={n_})")
262262
tfm_train += [RandAugmentFixMatch(n_)]
263263

264264
if "randaugment2" in choices:
265265
n_ = cfg.INPUT.RANDAUGMENT_N
266-
print("+ randaugment2 (n={})".format(n_))
266+
print(f"+ randaugment2 (n={n_})")
267267
tfm_train += [RandAugment2(n_)]
268268

269269
if "colorjitter" in choices:
@@ -293,21 +293,18 @@ def _build_transform_train(cfg, choices, target_size, normalize):
293293
if "cutout" in choices:
294294
cutout_n = cfg.INPUT.CUTOUT_N
295295
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})")
297297
tfm_train += [Cutout(cutout_n, cutout_len)]
298298

299299
if "normalize" in choices:
300300
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})"
303302
)
304303
tfm_train += [normalize]
305304

306305
if "gaussian_noise" in choices:
307306
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})"
311308
)
312309
tfm_train += [GaussianNoise(cfg.INPUT.GN_MEAN, cfg.INPUT.GN_STD)]
313310

@@ -337,8 +334,7 @@ def _build_transform_test(cfg, choices, target_size, normalize):
337334

338335
if "normalize" in choices:
339336
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})"
342338
)
343339
tfm_test += [normalize]
344340

dassl/engine/da/cdac.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from torch.optim.lr_scheduler import LambdaLR
77

88
from dassl.data import DataManager
9-
from dassl.optim import build_optimizer, build_lr_scheduler
9+
from dassl.optim import build_optimizer
1010
from dassl.utils import count_num_param
1111
from dassl.engine import TRAINER_REGISTRY, TrainerXU
1212
from dassl.metrics import compute_accuracy

0 commit comments

Comments
 (0)