Skip to content

Commit

Permalink
Fixes from comments
Browse files Browse the repository at this point in the history
  • Loading branch information
GalyaZalesskaya committed Feb 15, 2024
1 parent 0db4887 commit 195e43f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion model_api/python/openvino/model_api/models/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,13 @@ def postprocess(self, outputs, meta):
)

def get_saliency_maps(self, outputs: Dict) -> np.ndarray:
"""
Returns saliency map model output. In hierarchical case reorder saliency maps
to match the order of labels in .XML meta.
"""
saliency_maps = outputs.get(_saliency_map_name, np.ndarray(0))
if not self.hierarchical:
return saliency_maps
# In hierarchical case reorder saliency maps to match the order of labels in .XML meta
reordered_saliency_maps = [[] for _ in range(len(saliency_maps))]
for batch in range(len(saliency_maps)):
for label in self.labels:
Expand Down

0 comments on commit 195e43f

Please sign in to comment.