Error metrics

eval_2DFace

class pftracker.modules.metrics.eval_2DFace.error(det_tuple, gt_file)[source]

2D face tracking evaluation.

This function reads ground truth annotations of bounding box from .txt files and then calculates precision, recall and F1-score error metrics between detections that have been obtained from particle filter estimation and ground truth annotations.

Ground truth annotations shoud be in the format:
  • x,y,w,h

where (x, y) are the center bounding box coordinates and (w, h) are the bounding box width and height respectively.

Besides, it is possible to read annotations from the ‘YouTube Dataset’ format:

  • name, [ignore], x, y, w, h, [ignore], [ignore]

This dataset was used for testing the framework and is available at www.cs.tau.ac.il/˜wolf/ytfaces

Parameters
  • det_tuple (tuple) – tuple with particle filter estimation results

  • gt_file (str) – .txt file directory of ground truth annotations

Returns

8-element tuple containing

  • P (array): precision value per frame, array with (1, number_of_frames) dimension

  • R (array): recall value per frame, array with (1, number_of_frames) dimension

  • P_mean (float): precision mean value

  • R_mean (float): recall mean value

  • P_std (float): precision standard deviation value

  • R_std (float): recall standard deviation value

  • F1Score_mean (float): F-1-score mean metric

  • F1Score_std (float): F-1-score standard deviation value

plotError_ui

class pftracker.modules.metrics.plotError_ui.plotE(parent, P, R, P_mean, R_mean)[source]

Plot precision and recall error per frame on the graphical interface.

Parameters
  • P (array) – precision value per frame, array with (1, number_of_frames) dimension

  • R (array) – recall value per frame, array with (1, number_of_frames) dimension

  • P_mean (float) – precision mean value

  • R_mean (float) – recall mean value

PrecRecall

class pftracker.modules.metrics.PrecRecall.calc_PrecRecall(det, gt)[source]

Compute Precision, Recall and F1-score metrics for rectangular bounding boxes.

Parameters
  • det (array) – detection vector bounding box [startX startY endX endY]

  • gt (array) – ground truth vector bounding box [startX startY endX endY]

Returns

3-element tuple containing

  • precision (array): precision value per frame, array with (1, number_of_frames) dimension

  • recall (array): recall value per frame, array with (1, number_of_frames) dimension

  • F1Score (array): F-1-score metric per frame, array with (1, number_of_frames) dimension