blob: ae6cb5e7103ab064a16b9ea1814dc1dd1a762a17 [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#pragma once
6
7#include "Types.hpp"
8#include "ArmnnNetworkExecutor.hpp"
9#include "DetectedObject.hpp"
10#include "IDetectionResultDecoder.hpp"
11#include "NonMaxSuppression.hpp"
12
13namespace od
14{
15
16class YoloResultDecoder : public IDetectionResultDecoder
17{
18
19public:
20 /**
21 * Constructs Yolo V3 inference reuslts decoder.
22 *
23 * @param NMSThreshold non max suppression threshold
24 * @param ClsThreshold class probability threshold
25 * @param ObjectThreshold detected object score threshold
26 */
27 YoloResultDecoder(float NMSThreshold, float ClsThreshold, float ObjectThreshold);
28
Éanna Ó Catháinc6ab02a2021-04-07 14:35:25 +010029 DetectedObjects Decode(const common::InferenceResults<float>& results,
30 const common::Size& outputFrameSize,
31 const common::Size& resizedFrameSize,
Éanna Ó Catháin919c14e2020-09-14 17:36:49 +010032 const std::vector <std::string>& labels) override;
33private:
34 float m_NmsThreshold;
35 float m_ClsThreshold;
36 float m_objectThreshold;
37
38 unsigned int m_boxElements = 4U;
39 unsigned int m_confidenceElements = 1U;
40 unsigned int m_numClasses = 80U;
41 unsigned int m_numBoxes = 2535U;
42};
43}// namespace od