dataeval.data.ClassFilter

class dataeval.data.ClassFilter(classes, filter_detections=True)

Select dataset indices based on class labels, keeping only those present in classes.

Filters images by class (cardinality) and, for object-detection and segmentation datasets, masks out the detections that belong to other classes (content). Reads each datum through preceding operations, so [Relabel(...), ClassFilter([0])] filters on the relabeled vocabulary.

Parameters:
classes : Sequence[int]

The sequence of classes to keep.

filter_detections : bool, default True

Whether to filter detections from targets for object detection and segmentation datasets.

apply(view)

Apply this operation by mutating view in place.

apply_metadata(metadata)

Return possibly-updated dataset-level metadata (default: unchanged).