Fix wrong function name of ConvertToDetection

PiperOrigin-RevId: 523760961
This commit is contained in:
MediaPipe Team 2023-04-12 11:40:17 -07:00 committed by Copybara-Service
parent 776dceb588
commit ca0da8d26f

View File

@ -28,8 +28,7 @@ namespace mediapipe::tasks::components::containers {
constexpr int kDefaultCategoryIndex = -1; constexpr int kDefaultCategoryIndex = -1;
Detection ConvertToDetectionResult( Detection ConvertToDetection(const mediapipe::Detection& detection_proto) {
const mediapipe::Detection& detection_proto) {
Detection detection; Detection detection;
for (int idx = 0; idx < detection_proto.score_size(); ++idx) { for (int idx = 0; idx < detection_proto.score_size(); ++idx) {
detection.categories.push_back( detection.categories.push_back(
@ -78,8 +77,7 @@ DetectionResult ConvertToDetectionResult(
DetectionResult detection_result; DetectionResult detection_result;
detection_result.detections.reserve(detections_proto.size()); detection_result.detections.reserve(detections_proto.size());
for (const auto& detection_proto : detections_proto) { for (const auto& detection_proto : detections_proto) {
detection_result.detections.push_back( detection_result.detections.push_back(ConvertToDetection(detection_proto));
ConvertToDetectionResult(detection_proto));
} }
return detection_result; return detection_result;
} }