fix args error (#362)

pull/365/head
Yixiao Fang 2022-07-21 10:36:39 +08:00 committed by GitHub
parent c3593472f4
commit 9582c6b1ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 4 deletions

View File

@ -710,13 +710,16 @@ class ColorJitter(BaseTransform):
img = results['img'].astype('uint8')
for fn_id in order:
if fn_id == 0 and brightness_factor is not None:
img = adjust_brightness(img, brightness_factor, self.backend)
img = adjust_brightness(
img, brightness_factor, backend=self.backend)
elif fn_id == 1 and contrast_factor is not None:
img = adjust_contrast(img, contrast_factor, self.backend)
img = adjust_contrast(
img, contrast_factor, backend=self.backend)
elif fn_id == 2 and saturation_factor is not None:
img = adjust_color(img, saturation_factor, self.backend)
img = adjust_color(
img, saturation_factor, backend=self.backend)
elif fn_id == 3 and hue_factor is not None:
img = adjust_hue(img, hue_factor, self.backend)
img = adjust_hue(img, hue_factor, backend=self.backend)
results['img'] = img
return results