Skip to content

Cascade

CascadeEnsemble

Bases: EnsembleBase

Ensemble method that iterates over the annotations and picks the first annotation that is not unannotated.

Source code in src/ensemble/cascade.py
 9
10
11
12
13
14
15
16
17
18
class CascadeEnsemble(EnsembleBase):
    """
    Ensemble method that iterates over the annotations and picks the first annotation that is not unannotated.
    """
    def run(self, annotations: List[Annotation]) -> Tuple[Union[List | np.array], int]:
        for annotation in annotations:
            if not annotation.unannotated:
                return annotation, 0

        return annotations[0], 1