Closed jdivis closed 2 years ago
The code is here.
# The mask should always be a boolean 64x64 mask, and then we
# can upsample it for the second stage.
source_mask_64 = th.ones_like(source_image_64)[:, :1]
source_mask_64[:, :, 20:] = 0
source_mask_256 = F.interpolate(source_mask_64, (256, 256), mode='nearest')
Basically, you can set whichever pixels you want to 0.
Try to replace the first two set the values of your choice to 0 for row and column.:
and
Got it, and to set other pixels to 0, we can just add more arrays, like:
source_mask_64[:,:,0:22,0:3] = 0 source_mask_64[:,:,0:18,3:7] = 0 source_mask_64[:,:,0:15,7:8] = 0 source_mask_64[:,:,0:13,8:10] = 0
to make whatever pattern we need. I was trying to figure out how that would be done with the one line, manipulating the values of: source_mask_64[:,:,0:22,0:3] = 0 But I see now that it should be a multilined approach. Thanks!
Good job! I see I was wrong when I said the first two :
. It is actually the following ones, as you did.
In the paper, I see masks that are non-rectangular (white blob in the sky in the image below):
but I think the 'mask' in the inpaint notebook is being applied on this line:
source_mask_64[:, :, 20:] = 0
which produces an image with a gray rectangle. Is there an example of how to create more complex masks?