Questions about some codes
- Dominant language
- Python
- Stars
- 275
- Forks
- 46
- PR merge metrics
- No merged PRs in 30d
Description
In your code:
` def add_noise(self, img: mge.Tensor) -> Tuple[mge.Tensor, float]:
"""
Args:
- img: [-black, camera_value_scale]
Returns:
- noisy_img
- iso
"""
N = img.shape[0]
isos = np.random.uniform(*self.opts.iso_range, size=(N, ))
k, b = self.noise_func(isos, value_scale=self.opts.camera_value_scale)
k = k.reshape(-1, 1, 1, 1)
b = b.reshape(-1, 1, 1, 1)
shot_noisy = megengine.random.poisson((img / k).clip(0, 1)) * k
read_noisy = megengine.random.normal(size=img.shape) * math.sqrt(b)
noisy = shot_noisy + read_noisy
noisy = F.round(noisy)
return noisy
`
It seems that clip(0,1) should not be used in the code `shot_noisy = megengine.random.poisson((img / k).clip(0, 1)) * k`, since most of (img / k)'s range is not between 0 and 1
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the add_noise code shown in the issue and trace self.noise_func, self.opts.iso_range, and self.opts.camera_value_scale to determine the intended range passed to the Poisson sampler. Compare that behavior with the raw-image noise model described by the repository, then verify whether the clip is intentional or should change. Done means the concern is resolved with a confirmed rationale and corresponding code or documentation update.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- computer-vision, machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100