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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iap.Uniform with translate_px causes translation well beyond specified limits #505

Closed
soswow opened this issue Nov 26, 2019 · 1 comment · Fixed by #508
Closed

iap.Uniform with translate_px causes translation well beyond specified limits #505

soswow opened this issue Nov 26, 2019 · 1 comment · Fixed by #508
Labels

Comments

@soswow
Copy link

soswow commented Nov 26, 2019

Here is an example of a problem:
https://colab.research.google.com/drive/1OM--s8zhyesrzugQxWvHdWRiawko8odx

seq = iaa.Sequential([
    iaa.Affine(
      translate_px=iap.Uniform(-100, 100) # BUG!
      # translate_px=(-100, 100) # Works fine
    ),
])

bbs = BoundingBoxesOnImage([
  BoundingBox(x1=200, x2=400, y1=200, y2=400)
], shape=img.shape)

imgs, bbois = seq(images=[img], bounding_boxes=[bbs])

Using this code ^ the resulting translation is massive. It's in hundreds of thousands when I use Uniform instead of defining translate_px as just a tuple.

@aleju aleju added the bug label Nov 26, 2019
@aleju
Copy link
Owner

aleju commented Nov 26, 2019

Yes, that seems wrong. You can use iap.DiscreteUniform instead of iap.Uniform until its fixed. Affine then understands that an absolute pixel amount is meant and not a relative amount.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants