diff options
author | Éanna Ó Catháin <eanna.ocathain@arm.com> | 2020-09-14 17:36:49 +0100 |
---|---|---|
committer | Jim Flynn <jim.flynn@arm.com> | 2020-09-14 18:40:01 +0000 |
commit | 919c14ef132986aa1514b2070ce6d19b5579a6ab (patch) | |
tree | 5c281e02a083768f65871cb861ab9b32ac7d8767 /samples/ObjectDetection/src/DetectedObject.cpp | |
parent | 589e3e81a86c83456580e112978bf7a0ed5f43ac (diff) | |
download | armnn-919c14ef132986aa1514b2070ce6d19b5579a6ab.tar.gz |
MLECO-929 Add Object Detection sample application using the public ArmNN C++ API
Change-Id: I14aa1b4b726212cffbefd6687203f93f936fa872
Signed-off-by: Éanna Ó Catháin <eanna.ocathain@arm.com>
Diffstat (limited to 'samples/ObjectDetection/src/DetectedObject.cpp')
-rw-r--r-- | samples/ObjectDetection/src/DetectedObject.cpp | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/samples/ObjectDetection/src/DetectedObject.cpp b/samples/ObjectDetection/src/DetectedObject.cpp new file mode 100644 index 0000000000..95f99a07d6 --- /dev/null +++ b/samples/ObjectDetection/src/DetectedObject.cpp @@ -0,0 +1,65 @@ +// +// Copyright © 2020 Arm Ltd and Contributors. All rights reserved. +// SPDX-License-Identifier: MIT +// + +#include "DetectedObject.hpp" + +namespace od +{ + +DetectedObject::DetectedObject() : + DetectedObject(0u, "", BoundingBox(), 0u) +{} + +DetectedObject::DetectedObject( + unsigned int id, + std::string label, + const BoundingBox &boundingBox, + float score) : + m_Id(id), + m_Label(std::move(label)), + m_BoundingBox(boundingBox), + m_Score(score) +{} + +unsigned int DetectedObject::GetId() const +{ + return m_Id; +} + +const std::string &DetectedObject::GetLabel() const +{ + return m_Label; +} + +const BoundingBox &DetectedObject::GetBoundingBox() const +{ + return m_BoundingBox; +} + +float DetectedObject::GetScore() const +{ + return m_Score; +} + +void DetectedObject::SetId(unsigned int id) +{ + m_Id = id; +} + +void DetectedObject::SetLabel(const std::string &label) +{ + m_Label = label; +} + +void DetectedObject::SetBoundingBox(const BoundingBox &boundingBox) +{ + m_BoundingBox = boundingBox; +} + +void DetectedObject::SetScore(float score) +{ + m_Score = score; +} +}// namespace od
\ No newline at end of file |