Tests utils

Classes and methods to compute metrics on the RAM extraction method, based on the ground truth vision extracted objects.

class tests.metrics_utils.DetectionScores[source]

Keeps track of true positives, false positive and false negative of the detected objects. Allow to fast compute precision, recall, and f1 scores.

property cat_f_scores

The per cartegory dictionary of the F-scores

property cat_precisions

The per cartegory dictionary of the precision

property cat_recalls

The per cartegory dictionary of the recall

property dict_summary

The mean precision, recall and F-score on all objects.

property mean_f_score

The mean F-score on all objects

property mean_precision

The mean precision on all objects

property mean_recall

The mean recall on all objects

update(det_dict)[source]
tests.metrics_utils.detection_stats(ram_list, vision_list)[source]

Returns the Precision, Recall and F1_score via comparing the RAM and vision lists. These metrics are computed based on MIN_DIST_DETECTION (default =5).

Parameters:
Returns:

A dictionary containing the per class metrics.

Return type:

dict

tests.metrics_utils.get_all_metrics(ram_list, vision_list)[source]

Computes the:

  • mean_iou

  • per_class_ious

  • only_in_ram

  • only_in_vision

  • objs_in_ram

  • objs_in_vision

  • dets ()

two lists of GameObjects (from the RAM extraction and from the vision extraction methods).

Parameters:
Returns:

A dictionary containing the per class metrics.

Return type:

dict

tests.metrics_utils.get_iou(obj1, obj2)[source]

Computes the intersection over union between two GameObjects.

Parameters:
tests.metrics_utils.print_all_stats(all_stats)[source]

Nicely prints the stats in the terminal.