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 xai for MaskRCNNModel #95

Merged
merged 5 commits into from
Jul 3, 2023

Conversation

Wovchena
Copy link
Collaborator

@Wovchena Wovchena commented Jul 3, 2023

No description provided.

@Wovchena Wovchena requested a review from sovrasov July 3, 2023 14:47
class InstanceSegmentationResult(NamedTuple):
segmentedObjects: List[Union[SegmentedObject, SegmentedObjectWithRects]]
# Contan per class saliency_maps and "feature_vector" model output if feature_vector exists
saliency_map: List[np.ndarray]
Copy link
Collaborator

Choose a reason for hiding this comment

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

In other Result objects saliency_map is just an np.ndarray. In OTX it's a list, but here we can unify the representation. Is there any particular reason to use list here?

Copy link
Collaborator Author

@Wovchena Wovchena Jul 3, 2023

Choose a reason for hiding this comment

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

Missing classes are represented as empty np.ndarray in that list. Should I fill the corresponding axes with zeros?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Since the only client of that wrapper here is an IS tiler, a list could be even more convenient. Let's leave it as is.

result->segmentedObjects.push_back(obj);
}
if (has_feature_vector_name) {
saliency_maps[obj.labelID - 1].push_back(obj.mask);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is that mask resized, or we don't have a flag similar to postprocess_semantic_masks?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Resized. There's on top

        if (postprocess_semantic_masks) {
            obj.mask = segm_postprocess(obj, raw_cls_mask, internalData.inputImgHeight, internalData.inputImgWidth);
        }

@Wovchena Wovchena merged commit 8bed31c into openvinotoolkit:master Jul 3, 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