MrGiovanni / ModelsGenesis

[MICCAI 2019 Young Scientist Award] [MEDIA 2020 Best Paper Award] Models Genesis
Other
729 stars 139 forks source link

Questions regarding image in-painting and out-painting #26

Open kaimingkuang opened 4 years ago

kaimingkuang commented 4 years ago

Thank you for your amazing work. I am implementing your method on my own dataset. I have questions regarding the PyTorch version of in-painting and out-painting. It looks like you replace the pixels within the window with random values in both transformations. For example, in in-painting, you use:

x[:, 
   noise_x:noise_x+block_noise_size_x, 
   noise_y:noise_y+block_noise_size_y, 
   noise_z:noise_z+block_noise_size_z] = np.random.rand(block_noise_size_x, 
                                                        block_noise_size_y, 
                                                        block_noise_size_z, ) * 1.0

which assigns random values to the block, instead of:

x[:, 
   noise_x:noise_x+block_noise_size_x, 
   noise_y:noise_y+block_noise_size_y, 
   noise_z:noise_z+block_noise_size_z] = np.random.rand()

In this case the block is replaced with a single random value, which is the case according to your paper:

We then assign a random value to all pixels outside the window while retaining the original intensities for the pixels within. As for in-painting, we retain the original intensities outside the window and replace the intensity values of the inner pixels with a constant value.

This is also the case suggested by fig.1 in the paper. Which one is correct? Also I don't quite understand why the random noise is multiplied with 1.0 in both in-painting and out-painting. Since the np.random.rand function generates float numbers, the multiplication seems unnecessary.

kaigelee commented 1 year ago

请问您解决了吗??