class documentation

Metadata for a YOLO head.

Class Method validate_task_specific_fields Validate that YOLO metadata fields match a supported task.
Instance Variable angles_outputs Optional output names for oriented bounding box angles.
Instance Variable is_softmax Optional flag indicating whether YOLO instance segmentation outputs already contain softmax probabilities.
Instance Variable keypoints_outputs Optional output names for keypoints.
Instance Variable mask_outputs Optional output names for mask coefficients.
Instance Variable n_keypoints Optional number of keypoints per box for YOLO keypoint detection.
Instance Variable n_prototypes Optional number of prototypes per box for YOLO instance segmentation.
Instance Variable protos_outputs Optional output name for mask prototypes.
Instance Variable strides Optional per-head strides.
Instance Variable subtype YOLO family decoding subtype, such as "yolov5".
Instance Variable yolo_outputs Output names for the YOLO grid outputs.

Inherited from HeadObjectDetectionMetadata:

Instance Variable anchors Optional predefined boxes of different sizes and aspect ratios. The innermost values describe box sizes, the middle values group anchors per output, and the outer values are ordered from smallest to largest output.
Instance Variable classes Names of classes detected by the model.
Instance Variable conf_threshold Confidence threshold above which a detection is considered valid.
Instance Variable iou_threshold Non-maximum suppression IoU threshold for filtering overlapping boxes.
Instance Variable max_det Maximum detections per image.
Instance Variable n_classes Number of classes detected by the model.

Inherited from HeadMetadata (via HeadObjectDetectionMetadata):

Class Variable model_config Undocumented
Instance Variable postprocessor_path Optional path to the postprocessor.
@model_validator(mode='before')
@classmethod
def validate_task_specific_fields(cls, values: dict[str, Any]) -> dict[str, Any]:

Validate that YOLO metadata fields match a supported task.

Parameters
values:dict[str, Any]Raw YOLO metadata fields.
Returns
dict[str, Any]The raw metadata fields when they describe a supported YOLO task and output set.
Raises
ValueErrorIf task-specific fields cannot infer a supported task, a field is not supported for the inferred task, a required output field is missing, or an output field is not supported for the inferred task.
angles_outputs: list[str] | None =

Optional output names for oriented bounding box angles.

is_softmax: bool | None =

Optional flag indicating whether YOLO instance segmentation outputs already contain softmax probabilities.

keypoints_outputs: list[str] | None =

Optional output names for keypoints.

mask_outputs: list[str] | None =

Optional output names for mask coefficients.

n_keypoints: int | None =

Optional number of keypoints per box for YOLO keypoint detection.

n_prototypes: int | None =

Optional number of prototypes per box for YOLO instance segmentation.

protos_outputs: str | None =

Optional output name for mask prototypes.

strides: list[int] | None =

Optional per-head strides.

subtype: str =

YOLO family decoding subtype, such as "yolov5".

yolo_outputs: list[str] =

Output names for the YOLO grid outputs.