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

Add python version of tilers #93

Merged
merged 27 commits into from
Jul 7, 2023
Merged

Conversation

sovrasov
Copy link
Collaborator

What does this PR do?

Fixes # (issue)

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

@sovrasov
Copy link
Collaborator Author

sovrasov commented Jul 3, 2023

@Wovchena please have a look at python stuff. IS tiler is not fully finished (XAI is lacking). Also, tests are missing.

Copy link
Collaborator

@Wovchena Wovchena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All in all the design looks good

model_api/python/openvino/model_api/tilers/tiler.py Outdated Show resolved Hide resolved
model_api/python/openvino/model_api/tilers/tiler.py Outdated Show resolved Hide resolved
model_api/python/openvino/model_api/tilers/tiler.py Outdated Show resolved Hide resolved
model_api/python/openvino/model_api/tilers/detection.py Outdated Show resolved Hide resolved
model_api/python/openvino/model_api/tilers/detection.py Outdated Show resolved Hide resolved
model_api/python/openvino/model_api/tilers/detection.py Outdated Show resolved Hide resolved
model_api/python/openvino/model_api/tilers/detection.py Outdated Show resolved Hide resolved
map_pixel = cls_map[hi, wi]
merged_pixel = merged_map[class_idx][y_1 + hi, x_1 + wi]
if merged_pixel != 0:
merged_map[class_idx][y_1 + hi, x_1 + wi] = 0.5 * (map_pixel + merged_pixel)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that the first elements of saliency_maps[1:] are going to have smaller weights compared to the last elements if more that 2 maps overlap at any pixel. The last elem has weight 0.5, the previous 0.25 etc. Is this intentional?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's a heuristic for merging. Max looks more natural, but during the initial experiments it produced more artifacts. I'll have a look at this one more time.

@sovrasov sovrasov marked this pull request as ready for review July 5, 2023 17:55
@sovrasov
Copy link
Collaborator Author

sovrasov commented Jul 6, 2023

@Wovchena please, have a look at tests implementation. CPP tests currently just skip tiling models.

@Wovchena Wovchena merged commit 3c3156b into openvinotoolkit:master Jul 7, 2023
16 checks passed
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.

2 participants