ArmNN
 22.08
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 (cxxopts::Options &options, std::vector< std::string > &required) 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 177 of file YoloInferenceTest.hpp.

Constructor & Destructor Documentation

◆ YoloTestCaseProvider()

YoloTestCaseProvider ( TConstructModelCallable  constructModel)
inlineexplicit

Definition at line 181 of file YoloInferenceTest.hpp.

182  : m_ConstructModel(constructModel)
183  {
184  }

Member Function Documentation

◆ AddCommandLineOptions()

virtual void AddCommandLineOptions ( cxxopts::Options &  options,
std::vector< std::string > &  required 
)
inlineoverridevirtual

Reimplemented from IInferenceTestCaseProvider.

Definition at line 186 of file YoloInferenceTest.hpp.

187  {
188  options
189  .allow_unrecognised_options()
190  .add_options()
191  ("d,data-dir", "Path to directory containing test data", cxxopts::value<std::string>(m_DataDir));
192 
193  Model::AddCommandLineOptions(options, m_ModelCommandLineOptions, required);
194  }

◆ GetTestCase()

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

Implements IInferenceTestCaseProvider.

Definition at line 218 of file YoloInferenceTest.hpp.

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

◆ ProcessCommandLineOptions()

virtual bool ProcessCommandLineOptions ( const InferenceTestOptions commonOptions)
inlineoverridevirtual

Reimplemented from IInferenceTestCaseProvider.

Definition at line 196 of file YoloInferenceTest.hpp.

References armnn::test::ValidateDirectory().

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

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