File size: 1,099 Bytes
e287bc1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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)