Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is compose_image_withshift #62

Open
bluesky314 opened this issue Jul 16, 2020 · 4 comments
Open

What is compose_image_withshift #62

bluesky314 opened this issue Jul 16, 2020 · 4 comments

Comments

@bluesky314
Copy link

I had some confusion about the function compose_image_withshift and why is needed as opposed to just the regular composition? How is it using the seg mask?

@senguptaumd
Copy link
Owner

While training on real images without supervision, we compose the foreground on the same background but after shifting it left or right. We use a discriminator on the composed image to pick inconsistency in matting. Now if it is composed back to the same background this inconsistency is not noticeable, but after applying a random shift it might be more noticeable. We do also compose the image into a random background from a different scene. So either compose into a random background or same background with a small shift.

@leemengxing
Copy link

this function n=np.random.randint(-(y1-10),al_tmp.shape[1]-y2-10), sometimes will happen ValueError: low >= high. why? @senguptaumd

@senguptaumd
Copy link
Owner

np.random.randint(x,y) generates random integers between x and y. This error means y<x.

@leemengxing
Copy link

leemengxing commented Aug 27, 2020

If people account for a large proportion of the image, it is easy to approach the boundary. that mean -(y1-10)>0,and al_tmp.shape[1]-y2-10<0. In this case, I'd better not shift. Is it possible to remove this operation? thks @senguptaumd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants