albumentations-team / albumentations_examples

Augmentations usage examples for albumentations library
MIT License
422 stars 99 forks source link

Support of a special Pad operation #16

Open rose-jinyang opened 2 years ago

rose-jinyang commented 2 years ago

Hello How are you? Thanks for contributing to this project. I am going to implement an operation for center-padding along with the shortest side while keeping the longest side. There is the operation named "CenterPadToSquare" in "imgaug" library (https://github.com/aleju/imgaug). image

But I can NOT find/implement such an operation/combination in this library. Could u help me?

ternaus commented 2 years ago

PadIfNeeded should do the job.

rose-jinyang commented 2 years ago

But PadIfNeeded requires the min_height and min_width values. "CenterPadToSquare" of "imgaug" does not require such values.