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

This fixes the size of the score array which will later be interpolated to create the final saliency map. #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

HuTobias
Copy link

The original calculation of the size of the scores array used "int(80/d)+1".
This works correctly for d with 80 % d != 0.
However, if 80 % d = 0, this creates an additional row and column which will never be reached by the loop "for i in range(0,80,d)".
For example, if the d=1, then the scores array would have size 81x81 instead of the intended 80x80(one value for each pixel).
d=5 hast the same problem, such that the last row and column are never reached by the loop and will always be 0.
When the saliency map is resized to 80x80 later, this results in saliency maps that are shifted to the top left and never have meaningful values in the last rows and columns.

I propose to use "int(79/d)+1" for the size of the scores array instead.
This keeps the functionality for d with 80 % d != 0 which just removing the +1 and using "int(80/d)" would not do.
In addition, "int(79/d)+1" results in exactly one less column and row for d with 80 % d = 0.
For example for d=1, "int(79/d)+1" correctly results in a scores array of size 80x80.

…o create the final saliency map. This array was too big for d with 80 % d = 0. For example for d=1, the socres array had size 81x81 instead of the intended 80x80(one value for each pixel)
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

Successfully merging this pull request may close these issues.

None yet

1 participant