the function ops.Brightness takes a fixed parameter brightness, how can I use random brightness during training ?
Hi,
thanks for the question. For random color augmentations you could use ColorTwist op with Uniform op for random values. In your pippeline __init__ function do something like:
self.twist = ops.ColorTwist(device="gpu")
self.rng1 = ops.Uniform(range=[0.5, 1.5])
self.rng2 = ops.Uniform(range=[0.875, 1.125])
self.rng3 = ops.Uniform(range=[-0.5, 0.5])
and then in define_graph you can do:
saturation = self.rng1()
contrast = self.rng1()
brightness = self.rng2()
hue = self.rng3()
# Obtain images ...
images = self.twist(
images, saturation=saturation, contrast=contrast, brightness=brightness, hue=hue)
More detailed documentation of this op you can find in DALI docs here
@awolant That works, thanks !
Most helpful comment
Hi,
thanks for the question. For random color augmentations you could use
ColorTwistop withUniformop for random values. In your pippeline__init__function do something like:and then in
define_graphyou can do:More detailed documentation of this op you can find in DALI docs here