필터 지우기
필터 지우기

Problems with the evaluateObjectDetection function

조회 수: 20 (최근 30일)
Patrizia
Patrizia 2024년 7월 15일 11:50
댓글: Patrizia 2024년 7월 16일 7:47
Hello, everyone,
I would like help with the function in the title line..
thanks.
I reproduce the code and its error below.
CODE:
% Evaluate object detection results
metrics = evaluateObjectDetection(detectionResultsTbl, groundTruthDataTbl);
% Extract precision and recall for a specific class ID (e.g. classID = 1)
classID = 1;
precision = metrics.ClassMetrics.Precision{classID};
recall = metrics.ClassMetrics.Recall{classID};
% Plot the precision-recall curve
figure
plot(recall, precision);
xlabel("Recall");
ylabel("Precision");
grid on;
title(sprintf("Average Precision = %.2f", metrics.ClassMetrics.mAP(classID)));
ERROR:
Error using evaluateObjectDetection>iFindOutputIdxsFromDS
Missing data in detectionResults. Unable to find Label data in detectionResults.
Error in evaluateObjectDetection (line 27)
predOutIdxs = iFindOutputIdxsFromDS(dsResultsCopy, 3, "detectionResults");
Error in untitled2 (line 306)
metrics = evaluateObjectDetection(detectionResultsTbl, groundTruthDataTbl);
In addition, I attach tables detectionResultsTbl and groundTruthDataTbl.

답변 (1개)

Muskan
Muskan 2024년 7월 15일 17:23
Hi, as per my understanding of the issue, it looks like the error message you are encountering is because "detectionResultsTbl" does not contain the required "Label" data. This is essential for the "evaluateObjectDetection" function to work properly.
Here are a few steps you can take to resolve this issue:
  1. Check the Structure of "detectionResultsTbl": Ensure that "detectionResultsTbl" has the necessary columns, including "Label". The table should typically include columns like "Label", "Score", "BoundingBox", etc.
  2. Verify the Contents of "detectionResultsTbl": Make sure that the "Label" column in "detectionResultsTbl" is populated with the appropriate data. If the column is missing or empty, the function will not be able to proceed.
  3. Correct the Data Preparation: If the "Label" column is missing or incorrectly populated, revisit the code where "detectionResultsTbl" is created. Ensure that you are correctly assigning labels to your detection results.
You can further refer to the documentation of "evaluateObjectDetection" for its correct usage: https://www.mathworks.com/help/vision/ref/evaluateobjectdetection.html
  댓글 수: 1
Patrizia
Patrizia 2024년 7월 16일 7:47
As you can see from the attached file, the 'detectionResultTbl' appears to be correctly populated.
Thank you anyway for your reply.
Patrizia

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

카테고리

Help CenterFile Exchange에서 Axis Labels에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by