1 // 2 // Copyright © 2020 Arm Ltd and Contributors. All rights reserved. 3 // SPDX-License-Identifier: MIT 4 // 5 6 #pragma once 7 8 #include "DetectedObject.hpp" 9 #include "Types.hpp" 10 11 #include <vector> 12 13 namespace od 14 { 15 16 class IDetectionResultDecoder 17 { 18 public: 19 /** 20 * @brief Returns decoded detected objects from a network model. 21 * @desc Outputs 4 vectors: bounding boxes, label, probabilities & number of detections. 22 * This function decodes network model output and converts it to expected format. 23 * 24 * @param[in] results Vector of outputs from a model. 25 * @param[in] outputFrameSize Struct containing height & width of output frame that is displayed. 26 * @param[in] resizedFrameSize Struct containing height & width of resized input frame before padding 27 * and inference. 28 * @param[in] labels Vector of network labels. 29 * @param[in] detectionScoreThreshold float value for the detection score threshold. 30 * 31 * @return Vector of decoded detected objects. 32 */ 33 virtual DetectedObjects Decode(const common::InferenceResults<float>& results, 34 const common::Size& outputFrameSize, 35 const common::Size& resizedFrameSize, 36 const std::vector<std::string>& labels) = 0; 37 38 }; 39 }// namespace od