DetectionEvaluator#
- class DetectionEvaluator(groundtruth: Dataset, name: str | None = None, **predictions: Dataset)[source]#
Bases:
DetectionEvaluatorBaseClass specialization for detection tasks Note that the constructor is the same as the base Evaluator
See also
Constructor of the DetectionEvaluator class. The only difference with vanilla
Evaluatoris the matches that is set to an empty dictionary.Attributes
- matches: dict[str, dict[str, DataFrame]] = {'category_agnostic': {}, 'category_specific': {}}#
Nested dictionary of DataFrames containing matched bounding boxes between groundtruth and corresponding prediction, depending on the way of computing matches (between all categories or between similar categories). Note that the the sub dictionaries will be empty until
compute_matches()is called
- name: str | None#
Name of Evaluator. Can be deduced from groundtruth’s dataset name and will be used in export functions like
DetectionEvaluator.to_fiftyone()
- groundtruth: pd.DataFrame#
DataFrame comprising annotation data. Must have at least
image_idcolumn
- predictions_dictionary: dict[str, pd.DataFrame]#
dictionary of DataFrames comprising prediction data. Must have at least
image_idandconfidencecolumns
- images: pd.DataFrame#
DataFrame comprising image data. This dataframe should be referred to by both gt and predictions with the
image_idcolumn
- images_root: Path#
Root folder where to grab images. Image filepath will be concatenation of images_root and their relative path
- label_map: dict[int, str]#
Mapping from category_id to category_str. If used, is generally taken from the groundtruth Dataset. The prediction must be compatible with it
Methods
add_predictions(predictions_name, predictions)Method to add predictions to the Evaluator from a dataframe.
add_predictions_dataset(predictions_name, ...)Method to add predictions to the Evaluator from a Dataset object.
compute_confusion_matrix([...])Compute confusion matrix to evaluate object detection.
compute_matches([predictions_names, ...])Get matches between predictions and targets of the Evaluator.
compute_precision_recall([...])Compute Precision Recall curves, along with Average precision, with respect to recall, for different minimum IoU values.
from_parquet(input_dir)Class method to construct an instance of this class or a subclass.
get_annotations_attributes([predictions_name])Get the name of columns related to annotations attributes.
Get the name of columns related to image attributes.
to_fiftyone([name, record_fo_ids, existing])Convert evaluator to fiftyone.
to_parquet(output_dir[, overwrite])Save the current object to a folder containing parquet files for dataframes inside this object, and a metadata.yaml file for other attributes.