epd_container

namespace EPD

A collection of use-case filters, namely for parsing usecase_config.json, Counting and Color-Matching usecaseMode.

class EPDContainer
#include <epd_container.hpp>

An Easy Perception Deployment(EPD) Container class object. The EPDContainer class object parses the session_config.json and usecase_config.json files to determine how an ONNX model can be deployed as an inference engine using the ONNXRuntime library.

Public Functions

EPDContainer(void)

A Constructor function.

~EPDContainer(void)

A Destructor function.

bool isInit(void)

A Getter function that gets the bool variable, hasInitialized.

bool isVisualize(void)

A Getter function that gets the bool variable, onlyVisualize.

bool isService(void)

A Getter function that gets the bool variable, isService.

int getHeight(void)

A Getter function that gets the int variable, frame_height.

int getWidth(void)

A Getter function that gets the int variable, frame_width.

void setInitBoolean(bool input)

A Mutator function that sets the bool variable, hasInitialized.

void setFrameDimension(int width, int height)

A Mutator function that sets the int variables, frame_width & frame_height.

void initORTSessionHandler()

A Mutator function that sets the appropriate precision-Level specific OrtBase object.

cv::Mat visualize(const EPD::EPDObjectDetection result, const cv::Mat input_image)
cv::Mat visualize(const EPD::EPDObjectTracking result, const cv::Mat input_image)

Public Members

Ort::P3OrtBase *p3_ort_session

An pointer for a Precision Level 3 OrtBase object.

Ort::P2OrtBase *p2_ort_session

An pointer for a Precision Level 2 OrtBase object.

unsigned int precision_level

The determined precision_level for an input ONNX model file, stated by the session_config.json.

const int IMG_CHANNEL = 3

A fixed integer for expected RGB 2D images.

const std::string PATH_TO_SESSION_CONFIG   = PATH_TO_PACKAGE "/config/session_config.json"

The constant filepath to session_config.json.

const std::string PATH_TO_USECASE_CONFIG   = PATH_TO_PACKAGE "/config/usecase_config.json"

The constant filepath to usecase_config.json.

std::string template_color_path

The filepath to a template color image for Color-Matching use-case filter.

std::string class_label_path

The filepath to the essential class label list, that maps classIndices to human-understandable object text labels.

std::string onnx_model_path

The filepath to an input ONNX model file.

unsigned int useCaseMode

The selected use-case mode. Values can only be 0,1,2.

See

usecase_config.hpp

for more details.

.

std::vector<std::string> countClassNames

A subset of selected object names from an input label list, used for Counting use-case filter.

std::vector<cv::Ptr<cv::Tracker>> trackers

A string name for user-selected OpenCV tracker, used for Tracking use-case filter.

std::string tracker_type
std::vector<int> tracker_logs
std::vector<EPD::LabelledRect2d> tracker_results
bool requestAddressed
std::vector<std::string> classNames

A list of human-understandable object text labels from input label list.

Private Functions

void setModelConfigFile()

A Mutator function that parses the session_config.json file.

void setUseCaseConfigFile()

A Mutator function that parses the usecase_config.json file.

void setPrecisionLevel()

A Mutator function that does a test initialization of an OrtBase object based on an input ONNX model file and determines the expected precision level.

void setLabelList()

A Mutator function that parses the input label list .txt file into the variable, classNames.

Private Members

bool hasInitialized

A boolean to indicate that OrtBase object has been initialized.

bool onlyVisualize

A boolean to determine the type of final user output.

bool onlyService

A boolean to determine whether EPD acts as a service or a publisher.

int frame_width

Expected dimensions of the data provided by an input camera.

int frame_height