Borrar filtros
Borrar filtros

Problems with the evaluateObjectDetection function

20 visualizaciones (últimos 30 días)
Patrizia
Patrizia el 15 de Jul. de 2024 a las 11:50
Comentada: Patrizia el 16 de Jul. de 2024 a las 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.

Respuestas (1)

Muskan
Muskan el 15 de Jul. de 2024 a las 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 comentario
Patrizia
Patrizia el 16 de Jul. de 2024 a las 7:47
As you can see from the attached file, the 'detectionResultTbl' appears to be correctly populated.
Thank you anyway for your reply.
Patrizia

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by