Questions regarding image in-painting and out-painting

Open
#26 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
25/100
Issue type
Documentation
Clarity
Needs clarification
Activity status
Stale
Tech stack
python, pytorch

Research direction

Start from the PyTorch in-painting and out-painting implementation shown in the issue, then compare its assignments with the paper's wording and Figure 1. A complete response should clarify whether the block uses independent random values or one constant value, and whether multiplying np.random.rand by 1.0 has any purpose.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Jupyter Notebook
Stars
791
Forks
141
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MrGiovanni/ModelsGenesis

All issues in MrGiovanni/ModelsGenesis

Similar issues

More Machine Learning issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.