avalanche.evaluation.metrics.detection.get_detection_api_from_dataset
- avalanche.evaluation.metrics.detection.get_detection_api_from_dataset(dataset, supported_types: ~typing.Sequence[~typing.Tuple[str, ~typing.Tuple[~typing.Type] | ~typing.Type]] = (('coco', <class 'object'>), ('lvis_api', <class 'object'>)), default_to_coco: bool = True, none_if_not_found=False)[source]
Adapted from: https://github.com/pytorch/vision/blob/main/references/detection/engine.py
- Parameters:
dataset – The test dataset.
supported_types – The supported API types
default_to_coco – If True, if no API object can be found, the dataset will be converted to COCO.
none_if_not_found – If True, it will return None if no valid detection API object is found. Else, it will consider default_to_coco or will raise an error.
- Returns:
The detection object.