indexnet_matting icon indicating copy to clipboard operation
indexnet_matting copied to clipboard

Rare inconsistency for background image size during data loading

Open 983 opened this issue 1 year ago • 1 comments

To generate the synthetic dataset for alpha matting, foreground images are composited onto background images. This will only work if the background image is at least as large as the foreground image.

I noticed a small inconsistency between how backgrounds are resized in Composition_code.py and hldataset.py. The result is that sometimes the background image has a different scale than the background in the composited image, for example in training sample 35787.

Composite image (denormalized)

img

Background image

bg

The reason is that Composition_code.py will only resize the background if it is smaller than the foreground, while hldataset.py will always resize the background to the size of the foreground image, even if it is large enough and would not need to be resized.

This is a rare occurrence because the foreground images are usually larger than the background images, so it probably does not matter much.

983 avatar Jul 09 '23 14:07 983

@983 The code is provided by Adobe Image Matting dataset. Since the inconsistency is rare, I think it could better be left as it is so that it won't affect a lot of published work.

poppinace avatar Jul 13 '23 09:07 poppinace