gaze  0.1.0
Perform gaze tracking with common webcams.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
Public Member Functions | List of all members
itracker::ITracker Class Reference

Implements a wrapper around the pre-trained caffe model by Krafka2016. More...

#include "itracker/itracker.h"

Public Member Functions

 ITracker (const std::string &model_file, const std::string &weights_file, const std::string &mean_left_eye_file, const std::string &mean_right_eye_file, const std::string &mean_face_file)
 
cv::Vec2f predict (const cv::Mat &left_eye, const cv::Mat &right_eye, const cv::Mat &face, const cv::Mat &face_mask)
 

Detailed Description

Implements a wrapper around the pre-trained caffe model by Krafka2016.

Definition at line 31 of file itracker.h.

Constructor & Destructor Documentation

itracker::ITracker::ITracker ( const std::string model_file,
const std::string weights_file,
const std::string mean_left_eye_file,
const std::string mean_right_eye_file,
const std::string mean_face_file 
)

Initializes the iTracker.

Parameters
model_fileA path to the model file, usually a *_deploy.prototxt
weights_fileA path to the trained weights, usually a *.caffemodel
mean_left_filePath to a *.binaryproto file, holds the mean of left eyes of the training set
mean_right_filePath to a *.binaryproto file, holds the mean of right eyes of the training set
mean_face_filePath to a *.binaryprotofile, holds the mean of faces of the training set

Definition at line 140 of file itracker.cpp.

145  : impl(new ITrackerImpl(model_file, weights_file, mean_left_eye_file,
146  mean_left_eye_file, mean_face_file)) {
147 }

Member Function Documentation

cv::Vec2f itracker::ITracker::predict ( const cv::Mat left_eye,
const cv::Mat right_eye,
const cv::Mat face,
const cv::Mat face_mask 
)

Performs a forward step for the neural network.

Parameters
left_eyeA cropped left eye.
right_eyeA cropped right eye.
faceThe cropped face
face_maskA 25x25 matrix which has 1 where the face was in the original image (relative), and 0 at the other places
Returns
the prediction, x and y offsets from the camera in cm.

Definition at line 149 of file itracker.cpp.

150  {
151  return this->impl->predict(left_eye, right_eye, face, face_mask);
152 }

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