ArmNN
 20.05
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 181 of file YoloInferenceTest.hpp.

Constructor & Destructor Documentation

◆ YoloTestCaseProvider()

YoloTestCaseProvider ( TConstructModelCallable  constructModel)
inlineexplicit

Definition at line 185 of file YoloInferenceTest.hpp.

186  : m_ConstructModel(constructModel)
187  {
188  }

Member Function Documentation

◆ AddCommandLineOptions()

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

Reimplemented from IInferenceTestCaseProvider.

Definition at line 190 of file YoloInferenceTest.hpp.

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

◆ GetTestCase()

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

Implements IInferenceTestCaseProvider.

Definition at line 223 of file YoloInferenceTest.hpp.

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

◆ ProcessCommandLineOptions()

virtual bool ProcessCommandLineOptions ( const InferenceTestOptions commonOptions)
inlineoverridevirtual

Reimplemented from IInferenceTestCaseProvider.

Definition at line 201 of file YoloInferenceTest.hpp.

References armnn::test::ValidateDirectory().

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

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