blob: 98435e3cc9b463859386af1e610ec5209124ab3f [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
29 DetectedObjects Decode(const InferenceResults& results,
30 const Size& outputFrameSize,
31 const Size& resizedFrameSize,
32 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