"""BDD100K detection evaluator."""from__future__importannotationsfromvis4d.common.importsimportBDD100K_AVAILABLEfromvis4d.eval.scalabelimportScalabelDetectEvaluatorifBDD100K_AVAILABLE:frombdd100k.common.utilsimportload_bdd100k_configelse:raiseImportError("bdd100k is not installed.")
[docs]classBDD100KDetectEvaluator(ScalabelDetectEvaluator):"""BDD100K 2D detection evaluation class."""METRICS_DET="Det"METRICS_INS_SEG="InsSeg"def__init__(self,annotation_path:str,config_path:str,mask_threshold:float=0.0,)->None:"""Initialize the evaluator."""config=load_bdd100k_config(config_path)super().__init__(annotation_path=annotation_path,config=config.scalabel,mask_threshold=mask_threshold,)
[docs]def__repr__(self)->str:"""Concise representation of the dataset evaluator."""return"BDD100K Detection Evaluator"