Spoofing Detection Engine  1.0
Public Member Functions | List of all members
core::NeuralClassifierBase Class Reference

Base class for neural network classifiers. More...

#include <NeuralClassifierBase.h>

Inheritance diagram for core::NeuralClassifierBase:
Inheritance graph
[legend]
Collaboration diagram for core::NeuralClassifierBase:
Collaboration graph
[legend]

Public Member Functions

 NeuralClassifierBase ()=default
 Default constructor.
 
std::map< std::string, double > runNetwork (const cv::Mat &frame, core::Detection &detection)
 Run the classification network on the given frame. More...
 
- Public Member Functions inherited from core::NeuralBase
std::string getName ()
 Gets the name of the neural network. More...
 
double getInferenceTime ()
 Gets the inference time of the network. More...
 
void loadNetwork (std::string framework, std::string modelWeightsFile, std::string classesFile="", std::string modelConfigurationFile="", std::string inputLayerName="", std::string outputLayerName="")
 Loads the neural network from memory buffer. More...
 
void configureNetwork (std::string name, int inputWidth, int inputHeight, double scale, double mean0, double mean1, double mean2, std::string configBackend, std::string configTarget, double confidenceThreshold)
 Configures the network with various parameters. More...
 
std::vector< std::string > getOutputsNames (const cv::dnn::Net &net)
 Gets the names of the output layers of the network. More...
 

Additional Inherited Members

- Protected Member Functions inherited from core::NeuralBase
void readClassNames (const std::string &filePath)
 
- Protected Attributes inherited from core::NeuralBase
std::string mFramework
 
std::string mInputLayerName
 
std::string mOutputLayerName
 
std::string mName
 
cv::dnn::Net mNet
 
std::vector< std::string > classes
 
double scaleFactor = 1.0
 
cv::Scalar mean { 0.0, 0.0, 0.0 }
 
cv::Size size { 128, 128 }
 
cv::dnn::Backend selectedBackend
 
cv::dnn::Target selectedTarget
 
float confThreshold = 0.5F
 
std::map< std::string, cv::dnn::Backend > backends
 
std::map< std::string, cv::dnn::Target > targets
 

Detailed Description

Base class for neural network classifiers.

Provides a convenience wrapper to execute a neural network and obtain a map of class probabilities.

Member Function Documentation

◆ runNetwork()

std::map< std::string, double > core::NeuralClassifierBase::runNetwork ( const cv::Mat &  frame,
core::Detection detection 
)

Run the classification network on the given frame.

Parameters
frameImage to classify.
detectionDetection information associated with the image.
Returns
Map from class labels to probability scores.
Here is the caller graph for this function:

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