From 6105133edfb4c51137d511513ce249544d9cc3a7 Mon Sep 17 00:00:00 2001 From: yakhyo Date: Fri, 18 Oct 2024 09:04:38 +0000 Subject: [PATCH] refactor: Minor refactor for probability --- utils/transform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/transform.py b/utils/transform.py index 1cf9334..e08918f 100644 --- a/utils/transform.py +++ b/utils/transform.py @@ -102,7 +102,7 @@ def apply_adjustments(image, alpha=1.0, beta=0.0): apply_adjustments(image[:, :, 1], alpha=random.uniform(0.5, 1.5)) # Hue distortion - if random.choice([True, False]): + if random.random() >= 0.5: hue_shift = image[:, :, 0].astype(int) + random.randint(-18, 18) image[:, :, 0] = np.mod(hue_shift, 180)