class documentation
class HeadYOLOMetadata(HeadObjectDetectionMetadata):
Metadata for a YOLO head.
| Class Method | validate |
Validate that YOLO metadata fields match a supported task. |
| Instance Variable | angles |
Optional output names for oriented bounding box angles. |
| Instance Variable | is |
Optional flag indicating whether YOLO instance segmentation outputs already contain softmax probabilities. |
| Instance Variable | keypoints |
Optional output names for keypoints. |
| Instance Variable | mask |
Optional output names for mask coefficients. |
| Instance Variable | n |
Optional number of keypoints per box for YOLO keypoint detection. |
| Instance Variable | n |
Optional number of prototypes per box for YOLO instance segmentation. |
| Instance Variable | protos |
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 |
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 |
Confidence threshold above which a detection is considered valid. |
| Instance Variable | iou |
Non-maximum suppression IoU threshold for filtering overlapping boxes. |
| Instance Variable | max |
Maximum detections per image. |
| Instance Variable | n |
Number of classes detected by the model. |
Inherited from HeadMetadata (via HeadObjectDetectionMetadata):
| Class Variable | model |
Undocumented |
| Instance Variable | postprocessor |
Optional path to the postprocessor. |
@model_validator( mode='before')
@classmethod
def validate_task_specific_fields(cls, values: @classmethod
dict[ str, Any]) -> dict[ str, Any]:
¶
Validate that YOLO metadata fields match a supported task.
| Parameters | |
values:dict[ | Raw YOLO metadata fields. |
| Returns | |
dict[ | The raw metadata fields when they describe a supported YOLO task and output set. |
| Raises | |
ValueError | If 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. |