VisionServer  v2.1.1-1-g21dc5465
FRC vision library
TfModel Class Reference

#include <tfmodel.h>

+ Inheritance diagram for TfModel:

Public Types

enum class  Optimization { DEFAULT , EDGETPU }
 

Public Member Functions

 TfModel ()=delete
 
 TfModel (std::initializer_list< std::pair< const char *, Optimization > >, size_t=default_threading)
 
 TfModel (const char *def, const char *edge, size_t th=default_threading)
 
 TfModel (const char *m, size_t t=default_threading)
 
 TfModel (const TfModel &)=delete
 
 operator bool () const
 
bool isValid () const
 
bool isValidBuffer () const
 

Static Public Attributes

static size_t default_threading {std::thread::hardware_concurrency() / 2}
 

Protected Attributes

std::unique_ptr< tflite::FlatBufferModel > map
 
std::unique_ptr< tflite::Interpreter > model
 
std::shared_ptr< edgetpu::EdgeTpuContext > edgetpu_context
 
tflite::ops::builtin::BuiltinOpResolver resolver
 
cv::Mat input_tensor
 
cv::Size input_size
 

Detailed Description

Provides a base for all TensorFlow[Lite] based processing pipelines

Definition at line 26 of file tfmodel.h.

Member Enumeration Documentation

◆ Optimization

enum class TfModel::Optimization
strong
Enumerator
DEFAULT 
EDGETPU 

Definition at line 30 of file tfmodel.h.

Constructor & Destructor Documentation

◆ TfModel() [1/5]

TfModel::TfModel ( )
delete

◆ TfModel() [2/5]

TfModel::TfModel ( std::initializer_list< std::pair< const char *, Optimization > >  models,
size_t  th = default_threading 
)

Definition at line 39 of file tfmodel.cpp.

◆ TfModel() [3/5]

TfModel::TfModel ( const char *  def,
const char *  edge,
size_t  th = default_threading 
)
inline

Definition at line 37 of file tfmodel.h.

◆ TfModel() [4/5]

TfModel::TfModel ( const char *  m,
size_t  t = default_threading 
)
inline

Definition at line 39 of file tfmodel.h.

◆ TfModel() [5/5]

TfModel::TfModel ( const TfModel )
delete

Member Function Documentation

◆ operator bool()

TfModel::operator bool ( ) const
inline

Definition at line 43 of file tfmodel.h.

◆ isValid()

bool TfModel::isValid ( ) const
inline

Definition at line 44 of file tfmodel.h.

◆ isValidBuffer()

bool TfModel::isValidBuffer ( ) const
inline

Definition at line 45 of file tfmodel.h.

Member Data Documentation

◆ default_threading

size_t TfModel::default_threading {std::thread::hardware_concurrency() / 2}
inlinestatic

Definition at line 29 of file tfmodel.h.

◆ map

std::unique_ptr<tflite::FlatBufferModel> TfModel::map
protected

Definition at line 49 of file tfmodel.h.

◆ model

std::unique_ptr<tflite::Interpreter> TfModel::model
protected

Definition at line 50 of file tfmodel.h.

◆ edgetpu_context

std::shared_ptr<edgetpu::EdgeTpuContext> TfModel::edgetpu_context
protected

Definition at line 51 of file tfmodel.h.

◆ resolver

tflite::ops::builtin::BuiltinOpResolver TfModel::resolver
protected

Definition at line 52 of file tfmodel.h.

◆ input_tensor

cv::Mat TfModel::input_tensor
protected

Definition at line 54 of file tfmodel.h.

◆ input_size

cv::Size TfModel::input_size
protected

Definition at line 55 of file tfmodel.h.


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