Problem with plotting graph

조회 수: 1 (최근 30일)
Adrian Kleffler
Adrian Kleffler 2023년 5월 9일
이동: Walter Roberson 2023년 5월 10일
Hello, I trained Fast R-cnn detector and after I visualize graph of average precision for every class, each graph looks the same but the value of average precision is diferent for every class...
here is the code:
[ap, recall, precision] = evaluateDetectionPrecision(detectionResults,testData);
here i am showing average precision for first class:
recallv = cell2mat(recall);
precisionv = cell2mat(precision);
[r,index] = sort(recallv);
p = precisionv(index);
figure
plot(r,p)
xlabel("Recall")
ylabel("Precision")
grid on
title(sprintf("Average Precision = %.2f",ap(1)))
and the graphs looks the same for every class:
and also average precision for 4th class is 0... I dont know why... can anybody help me? why is the average precision for 4th class 0?
  댓글 수: 4
Walter Roberson
Walter Roberson 2023년 5월 9일
for i = 1 : length(ap)
recallv = recall{i};
precisionv = precision{i};
stuff goes here
title(sprintf("Average Precision = %.2f",ap(i)));
end
Adrian Kleffler
Adrian Kleffler 2023년 5월 9일
Can you insert it in my code please? I’m not sure if i understand you

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2023년 5월 9일
이동: Walter Roberson 2023년 5월 10일
for i = 1 : length(ap)
recallv = recall{i};
precisionv = precision{i};
[r,index] = sort(recallv);
p = precisionv(index);
figure
plot(r,p)
xlabel("Recall")
ylabel("Precision")
grid on
title(sprintf("Average Precision = %.2f",ap(i)));
end
However you might want to consider using subplot() or tiledlayout() to put multiple plots in the same figure instead of using individual figures.
  댓글 수: 1
Adrian Kleffler
Adrian Kleffler 2023년 5월 9일
이동: Walter Roberson 2023년 5월 10일
thank you so much!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by