poppinace / indexnet_matting

(ICCV'19) Indices Matter: Learning to Index for Deep Image Matting
Other
389 stars 90 forks source link

Rare inconsistency for background image size during data loading #37

Open 983 opened 1 year ago

983 commented 1 year ago

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.

poppinace commented 1 year ago

@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.