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

Question about tiled inference #101

Open
hoangkhoiLE opened this issue Apr 8, 2024 · 0 comments
Open

Question about tiled inference #101

hoangkhoiLE opened this issue Apr 8, 2024 · 0 comments

Comments

@hoangkhoiLE
Copy link

hoangkhoiLE commented Apr 8, 2024

🐛 Question about tiled inference

Hello, thank you for your excellent work. I understand the advantage of tiled inference, but the way we use it confuses me. For each tile, we multiply the result of the inference with the weight. However, at final step, we then divide it by the norm mask (in the merge function). In my opinion, the action of dividing the results by the norm mask seems to produce a result without a weighting mechanism. Could you please explain this further? Maybe we would need a norm_mask containing different weight with the weight of inference result (for example norm_mask is an amount of inferences in each pixels which is different with pyramid_patch_weight_loss) to normalize correctly our result ? Thank you in advance !

To Reproduce

  for tile, (x, y, tile_width, tile_height) in zip(batch, crop_coords):
      self.image[:, y : y + tile_height, x : x + tile_width] += tile * self.weight
      self.norm_mask[:, y : y + tile_height, x : x + tile_width] += self.weigh
  def merge(self) -> torch.Tensor:
      return self.image / self.norm_mask
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

1 participant