class documentation

class ClassificationAnnotation(Annotation):

View In Hierarchy

Dummy wrapper annotation for classification tasks.

There is no explicit annotation field for classification tasks, instead the class name of a detection is interpreted as the class label and interpreted as belonging to the entire image.

Multiple classification annotations are multi-hot encoded into a single vector with length equal to the total number of classes.

Static Method combine_to_numpy Combine classification annotations into a multi-hot label vector.
@staticmethod
@override
def combine_to_numpy(annotations: list[ClassificationAnnotation], classes: list[int], n_classes: int) -> np.ndarray:

Combine classification annotations into a multi-hot label vector.

Parameters
annotations:list[ClassificationAnnotation]Classification annotations to combine.
classes:list[int]Class IDs associated with the annotations.
n_classes:intTotal number of known classes.
Returns
np.ndarrayMulti-hot class label vector of shape (N, ) where N is the total number of classes.