Hello everyone, I am running object detector in Matlab ... after running detector on test image the result looks like this :
But I want my program to show also names for each class ... for example if there is an airplane i want to see the confidence and name airplane also...
Here is my code which runs detector on one of the images :
I = imread(testDataTbl.imageFilename{94});
I = imresize(I,inputSize(1:2));
[bboxes,scores] = detect(detector,I);
I = insertObjectAnnotation(I,'rectangle',bboxes,scores);
figure
imshow(I)

回答 (2 件)

Walter Roberson
Walter Roberson 2023 年 5 月 19 日

0 投票

FIrst (somehow) convert each score into its corresponding class name.
Then when you call insertObjectAnnotation pass the class name as the fourth parameter (where you are passing scores now)

1 件のコメント

Adrian Kleffler
Adrian Kleffler 2023 年 5 月 19 日
Don’t you know how to convert it?

サインインしてコメントする。

Birju Patel
Birju Patel 2023 年 5 月 25 日

0 投票

Any object detector that supports detection multple classes will return the labels as a third output argument:
[bboxes,scores,labels] = detect(detector,I);
You can create a string with the label and score:
str = string(labels) + ": " + scores;
I = insertObjectAnnotation(I,'rectangle',bboxes,str);

カテゴリ

ヘルプ センター および File ExchangeComputer Vision Toolbox についてさらに検索

質問済み:

2023 年 5 月 19 日

回答済み:

2023 年 5 月 25 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by