blob: a8a3cbb23a8ae9cdb135270c1f64798d274d0e7e [file] [log] [blame]
Éanna Ó Catháin919c14e2020-09-14 17:36:49 +01001//
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
13namespace od
14{
15
16class IDetectionResultDecoder
17{
18public:
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 */
Éanna Ó Catháinc6ab02a2021-04-07 14:35:25 +010033 virtual DetectedObjects Decode(const common::InferenceResults<float>& results,
34 const common::Size& outputFrameSize,
35 const common::Size& resizedFrameSize,
Éanna Ó Catháin919c14e2020-09-14 17:36:49 +010036 const std::vector<std::string>& labels) = 0;
37
38};
39}// namespace od