Open awused opened 2 years ago
Any change in nearest_aligned would go in https://github.com/victorca25/augmennt, but can you test what I commented here: https://github.com/victorca25/traiNNer/blob/12d006fd44ed304e4178839c53b1f3d95ca25dcb/codes/dataops/augmennt/augmennt/transforms.py#L2582
For the cases I tested, the images were aligned, but maybe in some cases it needs a larger blur kernel.
I've tested it on multiple files, it's not like the input file matters. I first noticed it as warping in the output of my models, which was obviously apparent and corrected after I implemented my own local fix, but my local fix is a hack that can't be merged that only works locally because I don't trigger any other code paths that use sample()
.
As the code is now it's simply wrong. I cannot guess how you tested it to make it appear correct, but my tests are repeatable at both 2x and 4x.
When using nearest_aligned the output is noticeably shifted down and to the right. This affects my models severely and causes noticeable warping in their output.
I used this code in augmentations.py to produce the output images:
original image
Output from
nearest_aligned
as per the above code:Output from
convert test.png -interpolate Average -filter point -resize 25% magick-nearest.png
:Explicitly sampling the top left corner closely matches the offset from
nearest_aligned
:convert test.png -define sample:offset=0%x0% -sample 25% magick-sampled-top-left.png