Éanna Ó Catháin | 919c14e | 2020-09-14 17:36:49 +0100 | [diff] [blame] | 1 | // |
| 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 | |
| 13 | namespace od |
| 14 | { |
| 15 | |
| 16 | class YoloResultDecoder : public IDetectionResultDecoder |
| 17 | { |
| 18 | |
| 19 | public: |
| 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áin | c6ab02a | 2021-04-07 14:35:25 +0100 | [diff] [blame] | 29 | DetectedObjects Decode(const common::InferenceResults<float>& results, |
| 30 | const common::Size& outputFrameSize, |
| 31 | const common::Size& resizedFrameSize, |
Éanna Ó Catháin | 919c14e | 2020-09-14 17:36:49 +0100 | [diff] [blame] | 32 | const std::vector <std::string>& labels) override; |
| 33 | private: |
| 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 |