ArmNN  NotReleased
YoloTestCaseProvider< Model > Class Template Reference

#include <YoloInferenceTest.hpp>

Inheritance diagram for YoloTestCaseProvider< Model >:
IInferenceTestCaseProvider

Public Member Functions

template<typename TConstructModelCallable >
 YoloTestCaseProvider (TConstructModelCallable constructModel)
 
virtual void AddCommandLineOptions (boost::program_options::options_description &options) override
 
virtual bool ProcessCommandLineOptions (const InferenceTestOptions &commonOptions) override
 
virtual std::unique_ptr< IInferenceTestCaseGetTestCase (unsigned int testCaseId) override
 
- Public Member Functions inherited from IInferenceTestCaseProvider
virtual ~IInferenceTestCaseProvider ()
 
virtual bool OnInferenceTestFinished ()
 

Detailed Description

template<typename Model>
class YoloTestCaseProvider< Model >

Definition at line 179 of file YoloInferenceTest.hpp.

Constructor & Destructor Documentation

◆ YoloTestCaseProvider()

YoloTestCaseProvider ( TConstructModelCallable  constructModel)
inlineexplicit

Definition at line 183 of file YoloInferenceTest.hpp.

184  : m_ConstructModel(constructModel)
185  {
186  }

Member Function Documentation

◆ AddCommandLineOptions()

virtual void AddCommandLineOptions ( boost::program_options::options_description &  options)
inlineoverridevirtual

Reimplemented from IInferenceTestCaseProvider.

Definition at line 188 of file YoloInferenceTest.hpp.

189  {
190  namespace po = boost::program_options;
191 
192  options.add_options()
193  ("data-dir,d", po::value<std::string>(&m_DataDir)->required(),
194  "Path to directory containing test data");
195 
196  Model::AddCommandLineOptions(options, m_ModelCommandLineOptions);
197  }
armnn::Runtime::CreationOptions::ExternalProfilingOptions options

◆ GetTestCase()

virtual std::unique_ptr<IInferenceTestCase> GetTestCase ( unsigned int  testCaseId)
inlineoverridevirtual

Implements IInferenceTestCaseProvider.

Definition at line 221 of file YoloInferenceTest.hpp.

222  {
223  std::unique_ptr<YoloTestCaseData> testCaseData = m_Database->GetTestCaseData(testCaseId);
224  if (!testCaseData)
225  {
226  return nullptr;
227  }
228 
229  return std::make_unique<YoloTestCase<Model>>(*m_Model, testCaseId, *testCaseData);
230  }

◆ ProcessCommandLineOptions()

virtual bool ProcessCommandLineOptions ( const InferenceTestOptions commonOptions)
inlineoverridevirtual

Reimplemented from IInferenceTestCaseProvider.

Definition at line 199 of file YoloInferenceTest.hpp.

References armnn::test::ValidateDirectory().

200  {
201  if (!ValidateDirectory(m_DataDir))
202  {
203  return false;
204  }
205 
206  m_Model = m_ConstructModel(commonOptions, m_ModelCommandLineOptions);
207  if (!m_Model)
208  {
209  return false;
210  }
211 
212  m_Database = std::make_unique<YoloDatabase>(m_DataDir.c_str());
213  if (!m_Database)
214  {
215  return false;
216  }
217 
218  return true;
219  }
bool ValidateDirectory(std::string &dir)

The documentation for this class was generated from the following file: