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
- 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:
ram_list (list of ocatari.vision.game_objects.GameObject) – The list of objects detected by the RAM extraction method
ram_list – The list of objects detected by the RAM extraction method
- Returns:
A dictionary containing the per class metrics.
- Return type:
- 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:
ram_list (list of ocatari.vision.game_objects.GameObject) – The list of objects detected by the RAM extraction method
ram_list – The list of objects detected by the RAM extraction method
- Returns:
A dictionary containing the per class metrics.
- Return type:
- tests.metrics_utils.get_iou(obj1, obj2)[source]
Computes the intersection over union between two GameObjects.
- Parameters:
obj1 (ocatari.ram.game_objects.GameObject or ocatari.vision.game_objects.GameObject) – The bouding box of the detected object in (x, y, w, h) format
obj2 (ocatari.ram.game_objects.GameObject or ocatari.vision.game_objects.GameObject) – The ground truth bouding box