Skip to main content

evaluate_keypoints

Function evaluate_keypoints 

Source
pub fn evaluate_keypoints(
    gt: &CocoDataset,
    dt: &CocoDetections,
    params: EvaluateParams<'_>,
    parity_mode: ParityMode,
    sigmas: HashMap<i64, Vec<f64>>,
) -> Result<EvalGrid, EvalError>
Expand description

Run the per-image OKS (iouType="keypoints") evaluation pass per ADR-0012. Thin wrapper over evaluate_with with the OksSimilarity kernel.

sigmas is the per-category sigma override map consumed by OksSimilarity::new: an empty map means “use crate::similarity::oks::COCO_PERSON_SIGMAS for every category” (quirk F1, corrected). Sigma resolution rules — including the COCO-person default and the 17-keypoint length contract — are documented on OksSimilarity.

§Caller responsibilities

  • Area ranges (quirk D5). The keypoints-canonical 3-entry grid (all, medium, large — pycocotools omits small) lives on the caller side; pass it through params.area_ranges. Reusing the detection-canonical 4-entry grid silently introduces an empty small bucket that diverges from the parity oracle.
  • params.use_cats=true is the standard configuration for keypoints; per-category sigmas resolve via OksSimilarity regardless.

§Quirks honored here

GTs and DTs must carry a keypoints field; absence raises EvalError::InvalidAnnotation. There is no parity-mode-conditional bbox synthesis fallback for keypoints (no J2 analog).

§Errors

Propagates EvalError from the underlying kernel and matching calls.