Skip to content

Commit 5abf5f6

Browse files
committed
print details for colorjitter
1 parent b845f8f commit 5abf5f6

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

dassl/data/transforms/transforms.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,10 @@ def _build_transform_train(cfg, choices, target_size, normalize):
228228
tfm_train += [RandomCrop(input_size, padding=crop_padding)]
229229

230230
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_})")
233233
tfm_train += [
234-
RandomResizedCrop(input_size, scale=s, interpolation=interp_mode)
234+
RandomResizedCrop(input_size, scale=s_, interpolation=interp_mode)
235235
]
236236

237237
if "random_flip" in choices:
@@ -267,13 +267,20 @@ def _build_transform_train(cfg, choices, target_size, normalize):
267267
tfm_train += [RandAugment2(n_)]
268268

269269
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+
)
271278
tfm_train += [
272279
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_,
277284
)
278285
]
279286

0 commit comments

Comments
 (0)