test1 / job (2) /code /eval_handler.py
ehovel2023's picture
Upload 11 files
e287bc1
raw
history blame
1.1 kB
from code.base import BaseEvaluation, RunConfig
class EvaluationHandler:
def __init__(
self,
endpoint: str,
token: str,
group_name: str,
images_dataset_id: str,
gt_dataset_id: str,
labels_dataset_id: str,
predictions_dataset_id: str,
prediction_name: str,
setting_file_name: str,
eval_class: BaseEvaluation,
):
self.run_config = RunConfig(
endpoint=endpoint,
token=token,
group_name=group_name,
images_dataset_id=images_dataset_id,
gt_dataset_id=gt_dataset_id,
labels_dataset_id=labels_dataset_id,
predictions_dataset_id=predictions_dataset_id,
prediction_name=prediction_name,
setting_file_name=setting_file_name,
)
self.eval_class = eval_class
def execute(self):
evaluation = self.eval_class(self.run_config)
eval_config = evaluation.preprocess()
eval_result = evaluation.evaluate(eval_config)
evaluation.postprocess(eval_result)