question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Wrong padding order used at RandomCrop

See original GitHub issue

🐛 Bug

According to the kornia docu left/ right or left, top, right, bottom order is used for 2D https://github.com/kornia/kornia/blob/87a0ead264ce5fc97997071acb9fe2286d6c425c/kornia/augmentation/augmentation.py#L645-L648

In pytorch docu (padding_left,padding_right) ,(padding_left,padding_right,padding_top,padding_bottom) orders are used

But in the code it’s mixed up. https://github.com/kornia/kornia/blob/87a0ead264ce5fc97997071acb9fe2286d6c425c/kornia/augmentation/augmentation.py#L717-L723

and here for 3D: https://github.com/kornia/kornia/blob/87a0ead264ce5fc97997071acb9fe2286d6c425c/kornia/augmentation/augmentation3d.py#L676-L678

Also pad_if_needed adds twice the necessary padding.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
shijianjiancommented, Dec 17, 2020

@FGeri @shijianjian is this still happenning ?

Yes. Hasn’t been fixed yet.

0reactions
edgarribacommented, Dec 16, 2020

@FGeri @shijianjian is this still happenning ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why isn't RandomCrop inserting the padding in pytorch?
padding (int or sequence) – Padding on each border. If a single int is provided this is used to pad all borders. so...
Read more >
Source code for detectron2.data.transforms.augmentation_impl
def __init__(self, prob=0.5, *, horizontal=True, vertical=False): """ Args: prob ... than the input image size, then it uses a random crop of the...
Read more >
Pytorch101: Data Preprocessing and Augmentation (Part 1)
To solve this kind of problem (since we cannot require users to give a ... In this case, we can use random-crop to...
Read more >
Why isn't RandomCrop inserting the padding in pytorch? - vision
I am getting odd images despite printing the transform the data is using: -- splits[i]='train' taskset=<learn2learn.data.task_dataset.
Read more >
Why and How to Implement Random Crop Data Augmentation
If we aim to apply a random crop to an object detection problem, ... Annotations that extend outside of frame throw an error...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found