Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Float input values for RandomGamma #1286

Closed
zahragolpa opened this issue Sep 15, 2022 · 1 comment
Closed

Float input values for RandomGamma #1286

zahragolpa opened this issue Sep 15, 2022 · 1 comment

Comments

@zahragolpa
Copy link
Contributor

馃悰 Bug

I get an error when I run RandomGamma transform with a float gamma_limit value.

To Reproduce

Steps to reproduce the behavior:

  1. Run RandomGamma with a float gamma_limit value.
import albumentations as A
import cv2

input_image_numpy = cv2.imread(PATH_TO_INPUT_IMAGE)
transform = A.Compose([A.RandomGamma(gamma_limit=(80.8, 120.2), p=1)])
transformed = transform(image=input_image_numpy)
transformed_image = transformed["image"]
cv2.imwrite('output.png', transformed_image)

The error I get:

ValueError: non-integer arg 1 for randrange()

Expected behavior

Should produce the output image even when input is float, as stated in the documentation.

Environment

  • Albumentations version: albumentations==1.1.0
  • Python version: Python 3.8.8
  • OS: macOS
zahragolpa added a commit to zahragolpa/albumentations that referenced this issue Sep 15, 2022
changed `random.randint` to `random.uniform` in `RandomGamma` to solve issue albumentations-team#1286 in Albumentations
Dipet pushed a commit that referenced this issue Sep 18, 2022
changed `random.randint` to `random.uniform` in `RandomGamma` to solve issue #1286 in Albumentations

Co-authored-by: Vladimir Iglovikov <ternaus@users.noreply.github.com>
@Dipet
Copy link
Collaborator

Dipet commented Sep 18, 2022

Fixed in #1287

@Dipet Dipet closed this as completed Sep 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants