CrowdDetectionEvaluator#
- class CrowdDetectionEvaluator(groundtruth: Dataset, name: str | None = None, **predictions: Dataset)[source]#
Bases:
DetectionEvaluatorBaseClass specialization for crowd detection and counting tasks. Note that the constructor is the same as the base Evaluator
See also
Constructor of the Evaluator object.
- Parameters:
groundtruth – Dataset object representing the ground truth with annotations, image data and label_map
name – Name of Evaluator. If set to None, will be deduced from groundtruth’s dataset name
**predictions – keyword arguments for additional datasets to compare the groundtruth to. Its images must match the groundtruth dataset (see add_prediction_dataset method below).
Attributes
- 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_count_error([groups, quantiles, ...])Compute Count error metrics, both absolute (in number of objects found) and relative (with respect to groundtruth number of objects) with respect to confidence threshold.
Compute nAP between detected points and ground truth according to the algorithm proposed in [Ref]
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.