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

Does unpatchify average between overlapping patches? #11

Open
ritulahoti opened this issue Jun 6, 2021 · 6 comments
Open

Does unpatchify average between overlapping patches? #11

ritulahoti opened this issue Jun 6, 2021 · 6 comments

Comments

@ritulahoti
Copy link

How do the unpatchify works for overlapping patches?
Does it average the values in overlapped area or it takes the value of the next patch as it is?
Thanks.

@dovahcrow
Copy link
Owner

Hi @ritulahoti it won't do average. If the patches are overlapped, patchify will de-overlapping and recover the original image if this condition holds The required condition to successfully recover the image using unpatchify is to have (width - patch_width) mod step_size = 0 when calling patchify. (as mentioned in readme)

@ritulahoti
Copy link
Author

Hi, thanks for a quick response.
I'm trying to patchify an image and unpatchify the segmentation maps of the generated patches. So, for given two overlapping patches with varying probability values within, what values does the overlapping section get? (Conditions are being met)

@dovahcrow
Copy link
Owner

dovahcrow commented Jun 6, 2021 via email

@ritulahoti
Copy link
Author

Alright, I got it.
However, in my segmentation experiment, after applying unpatchify, the output shows a shifted results. Although its de-overlapping, the segmentation results should not shift, right?

Also, any help on how can I average the overlapping regions value?

@dovahcrow
Copy link
Owner

Alright, I got it.
However, in my segmentation experiment, after applying unpatchify, the output shows a shifted results. Although its de-overlapping, the segmentation results should not shift, right?

Also, any help on how can I average the overlapping regions value?

This must be a bug if the result is shifted. Would you mind providing your image size and the step size/patch size you used?

For averaging the overlapping values, unfortunately, I think you need to change the code in thedef unpatchify since I didn't design this functionality into the library.

@ritulahoti
Copy link
Author

Sure.
Image size: (160,160,144), patch size: (64,64,64), step=32
Thanks.

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

2 participants