VisionServer  v2.1.1-1-g21dc5465
FRC vision library
MoveNet_< derived_t > Class Template Reference

#include <tfmodel.h>

+ Inheritance diagram for MoveNet_< derived_t >:
+ Collaboration diagram for MoveNet_< derived_t >:

Public Member Functions

 MoveNet_ (size_t th=default_threading)
 
 MoveNet_ (const char *model, Optimization opt=Optimization::DEFAULT, size_t th=default_threading)
 
 MoveNet_ (std::initializer_list< std::pair< const char *, Optimization > >, size_t th=default_threading)
 
bool isValidOutput () const
 
virtual void process (cv::Mat &io_frame) override
 
- Public Member Functions inherited from vs2::VisionServer::BasePipe
const std::string & getName () const
 
const std::shared_ptr< nt::NetworkTable > & getTable () const
 
virtual void init ()
 
virtual void close ()
 
- Public Member Functions inherited from TfModel
 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
 

Protected Member Functions

float getX (size_t idx) const
 
float getY (size_t idx) const
 
float getConfidence (size_t idx) const
 
- Protected Member Functions inherited from vs2::VPipeline< MoveNet_< void > >
 VPipeline ()=delete
 
 VPipeline (const VPipeline &)=delete
 
 VPipeline (const char *name)
 
 VPipeline (const std::string &name)
 
 VPipeline (std::string &&name)
 
virtual ~VPipeline ()=default
 
- Protected Member Functions inherited from vs2::VisionServer::BasePipe
 BasePipe (const char *name)
 
 BasePipe (const std::string &name)
 
 BasePipe (std::string &&name)
 
 BasePipe ()=delete
 
void setCamera (const VisionCamera &)
 
void setPipeline (const BasePipe &)
 
void setSource (const cs::VideoSource &)
 
void getFrame (cv::Mat &)
 
const cv::Mat1f & getSrcMatrix () const
 
const cv::Mat1f & getSrcDistort () const
 

Static Protected Member Functions

static bool isValidIdx (size_t idx)
 

Protected Attributes

const float * outputs
 
std::array< cv::Point2f, ~Output::TOTALpoints
 
- Protected Attributes inherited from TfModel
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
 

Private Types

typedef struct MoveNet_< derived_t > This_t
 

Additional Inherited Members

- Public Types inherited from TfModel
enum class  Optimization { DEFAULT , EDGETPU }
 
- Public Types inherited from MoveNet_B
enum class  Output {
  NOSE , L_EYE , R_EYE , L_EAR ,
  R_EAR , L_SHOULDER , R_SHOULDER , L_ELBOW ,
  R_ELBOW , L_WRIST , R_WRIST , L_HIP ,
  R_HIP , L_KNEE , R_KNEE , L_ANKLE ,
  R_ANKLE , TOTAL
}
 
- Static Public Member Functions inherited from vs2::VisionServer::BasePipe
static const std::shared_ptr< nt::NetworkTable > & ntable ()
 
- Static Public Attributes inherited from TfModel
static size_t default_threading {std::thread::hardware_concurrency() / 2}
 
- Static Public Attributes inherited from MoveNet_B
static const float confid_thresh = 0.3
 
static const char * default_model = "lite-model_movenet_singlepose_lightning_tflite_int8_4.tflite"
 
static const std::array< const char *,(size_t) Output::TOTALnames
 
static const std::array< std::pair< Output, Output >, 12 > connections
 

Detailed Description

template<class derived_t = void>
class MoveNet_< derived_t >

Runs a MoveNet pose estimation tflite model within a vision pipeline

Definition at line 169 of file tfmodel.h.

Member Typedef Documentation

◆ This_t

template<class derived_t = void>
typedef struct MoveNet_< derived_t > MoveNet_< derived_t >::This_t
private

Definition at line 170 of file tfmodel.h.

Constructor & Destructor Documentation

◆ MoveNet_() [1/3]

template<class derived_t = void>
MoveNet_< derived_t >::MoveNet_ ( size_t  th = default_threading)
inline

Definition at line 172 of file tfmodel.h.

◆ MoveNet_() [2/3]

template<class derived_t = void>
MoveNet_< derived_t >::MoveNet_ ( const char *  model,
Optimization  opt = Optimization::DEFAULT,
size_t  th = default_threading 
)
inline

Definition at line 174 of file tfmodel.h.

◆ MoveNet_() [3/3]

template<class derived_t >
MoveNet_< derived_t >::MoveNet_ ( std::initializer_list< std::pair< const char *, Optimization > >  ops,
size_t  th = default_threading 
)

Definition at line 248 of file tfmodel.h.

Member Function Documentation

◆ isValidOutput()

template<class derived_t = void>
bool MoveNet_< derived_t >::isValidOutput ( ) const
inline

Definition at line 178 of file tfmodel.h.

◆ process()

template<class derived_t >
void MoveNet_< derived_t >::process ( cv::Mat &  io_frame)
overridevirtual

Reimplemented from vs2::VPipeline< MoveNet_< void > >.

Definition at line 257 of file tfmodel.h.

◆ isValidIdx()

template<class derived_t = void>
static bool MoveNet_< derived_t >::isValidIdx ( size_t  idx)
inlinestaticprotected

Definition at line 183 of file tfmodel.h.

◆ getX()

template<class derived_t = void>
float MoveNet_< derived_t >::getX ( size_t  idx) const
inlineprotected

Definition at line 184 of file tfmodel.h.

◆ getY()

template<class derived_t = void>
float MoveNet_< derived_t >::getY ( size_t  idx) const
inlineprotected

Definition at line 185 of file tfmodel.h.

◆ getConfidence()

template<class derived_t = void>
float MoveNet_< derived_t >::getConfidence ( size_t  idx) const
inlineprotected

Definition at line 186 of file tfmodel.h.

Member Data Documentation

◆ outputs

template<class derived_t = void>
const float* MoveNet_< derived_t >::outputs
protected

Definition at line 188 of file tfmodel.h.

◆ points

template<class derived_t = void>
std::array<cv::Point2f, ~Output::TOTAL> MoveNet_< derived_t >::points
protected

Definition at line 189 of file tfmodel.h.


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