diff options
author | Eanna O Cathain <eanna.ocathain@arm.com> | 2022-03-03 15:58:10 +0000 |
---|---|---|
committer | TeresaARM <teresa.charlinreyes@arm.com> | 2022-04-13 14:27:44 +0000 |
commit | 2f0ddb67d8f9267ab600a8a26308cab32f9e16ac (patch) | |
tree | 0eab15a96ebf1e21e60347804a08144380e53800 /samples/ObjectDetection/src/ObjectDetectionPipeline.cpp | |
parent | bab8fa9a11cf3bfef4b72fb757b81575b6fd75f0 (diff) | |
download | armnn-2f0ddb67d8f9267ab600a8a26308cab32f9e16ac.tar.gz |
MLECO-2492 Add CPP OD example with TFLITE-ArmnnDelegate
Signed-off-by: Dvir Markovich <dvir.markovich@arm.com>
Change-Id: If412c15ba49abe8370a570260b0a8ed8de305b7c
Diffstat (limited to 'samples/ObjectDetection/src/ObjectDetectionPipeline.cpp')
-rw-r--r-- | samples/ObjectDetection/src/ObjectDetectionPipeline.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/samples/ObjectDetection/src/ObjectDetectionPipeline.cpp b/samples/ObjectDetection/src/ObjectDetectionPipeline.cpp index 077caa40cb..2c4a76d35a 100644 --- a/samples/ObjectDetection/src/ObjectDetectionPipeline.cpp +++ b/samples/ObjectDetection/src/ObjectDetectionPipeline.cpp @@ -11,8 +11,8 @@ namespace od ObjDetectionPipeline::ObjDetectionPipeline(std::unique_ptr<common::ArmnnNetworkExecutor<float>> executor, std::unique_ptr<IDetectionResultDecoder> decoder) : - m_executor(std::move(executor)), - m_decoder(std::move(decoder)){} + m_executor(std::move(executor)), + m_decoder(std::move(decoder)){} void od::ObjDetectionPipeline::Inference(const cv::Mat& processed, common::InferenceResults<float>& result) { @@ -39,8 +39,8 @@ void ObjDetectionPipeline::PreProcessing(const cv::Mat& frame, cv::Mat& processe MobileNetSSDv1::MobileNetSSDv1(std::unique_ptr<common::ArmnnNetworkExecutor<float>> executor, float objectThreshold) : - ObjDetectionPipeline(std::move(executor), - std::make_unique<SSDResultDecoder>(objectThreshold)) + ObjDetectionPipeline(std::move(executor), + std::make_unique<SSDResultDecoder>(objectThreshold)) {} void MobileNetSSDv1::PreProcessing(const cv::Mat& frame, cv::Mat& processed) @@ -52,13 +52,12 @@ void MobileNetSSDv1::PreProcessing(const cv::Mat& frame, cv::Mat& processed) processed.convertTo(processed, CV_32FC3, 1 / 127.5, -1); } } - YoloV3Tiny::YoloV3Tiny(std::unique_ptr<common::ArmnnNetworkExecutor<float>> executor, float NMSThreshold, float ClsThreshold, float ObjectThreshold) : - ObjDetectionPipeline(std::move(executor), - std::move(std::make_unique<YoloResultDecoder>(NMSThreshold, - ClsThreshold, - ObjectThreshold))) + ObjDetectionPipeline(std::move(executor), + std::move(std::make_unique<YoloResultDecoder>(NMSThreshold, + ClsThreshold, + ObjectThreshold))) {} void YoloV3Tiny::PreProcessing(const cv::Mat& frame, cv::Mat& processed) @@ -72,11 +71,12 @@ void YoloV3Tiny::PreProcessing(const cv::Mat& frame, cv::Mat& processed) IPipelinePtr CreatePipeline(common::PipelineOptions& config) { - auto executor = std::make_unique<common::ArmnnNetworkExecutor<float>>(config.m_ModelFilePath, config.m_backends); - + auto executor = std::make_unique<common::ArmnnNetworkExecutor<float>>(config.m_ModelFilePath, + config.m_backends, + config.m_ProfilingEnabled); if (config.m_ModelName == "SSD_MOBILE") { - float detectionThreshold = 0.6; + float detectionThreshold = 0.5; return std::make_unique<od::MobileNetSSDv1>(std::move(executor), detectionThreshold @@ -99,4 +99,4 @@ IPipelinePtr CreatePipeline(common::PipelineOptions& config) } } -}// namespace od
\ No newline at end of file +}// namespace od |