Skip to content

Commit 36a6c56

Browse files
Pass name and confidence separately
Signed-off-by: Ashwin Vaidya <[email protected]>
1 parent ddcc269 commit 36a6c56

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/python/model_api/visualizer/scene/classification.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ def __init__(self, image: Image, result: ClassificationResult, layout: Union[Lay
2929
def _get_labels(self, result: ClassificationResult) -> list[Label]:
3030
labels = []
3131
if result.top_labels is not None and len(result.top_labels) > 0:
32-
labels.extend([Label(label=str(label)) for label in result.top_labels])
32+
for label in result.top_labels:
33+
if label.name is not None:
34+
labels.append(Label(label=label.name, score=label.confidence))
3335
return labels
3436

3537
def _get_overlays(self, result: ClassificationResult) -> list[Overlay]:

0 commit comments

Comments
 (0)