Skip to content

Commit

Permalink
update transforms.py (#1287)
Browse files Browse the repository at this point in the history
changed `random.randint` to `random.uniform` in `RandomGamma` to solve issue #1286 in Albumentations

Co-authored-by: Vladimir Iglovikov <ternaus@users.noreply.github.com>
  • Loading branch information
zahragolpa and ternaus committed Sep 18, 2022
1 parent b1af92a commit 8c98654
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion albumentations/augmentations/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -1389,7 +1389,7 @@ def apply(self, img, gamma=1, **params):
return F.gamma_transform(img, gamma=gamma)

def get_params(self):
return {"gamma": random.randint(self.gamma_limit[0], self.gamma_limit[1]) / 100.0}
return {"gamma": random.uniform(self.gamma_limit[0], self.gamma_limit[1]) / 100.0}

def get_transform_init_args_names(self):
return ("gamma_limit", "eps")
Expand Down

0 comments on commit 8c98654

Please sign in to comment.