from dataclasses import dataclass from typing import Optional from kolena.workflow import Inference from kolena.workflow.annotation import Keypoints @dataclass(frozen=True) class PoseEstimate(Inference): skeleton: Optional[Keypoints] = None # leave empty if nothing is detected confidence: Optional[float] = None
The inference produced by a model.
Typically the structure of this object closely mirrors the structure of the
GroundTruth for a workflow, but this is not a requirement.
This object may contain any combination of scalars (e.g.
Annotation objects, or lists of these objects.
A model processing a
Composite test sample can produce an inference result for each
of its elements. To associate an inference result to each test sample element, put the attributes and/or annotations
DataObject and use the same attribute name as that used in the
Continue with the example given in
Composite, where the
FacePairSample test sample
type is defined using a pair of images under the
target members, we can design a corresponding
inference type with image-level annotations defined in the
from dataclasses import dataclass from kolena.workflow import DataObject, Inference from kolena.workflow.annotation import BoundingBox, Keypoints @dataclass(frozen=True) class FaceRegion(DataObject): bounding_box: BoundingBox keypoints: Keypoints @dataclass(frozen=True) class FacePair(Inference): source: FaceRegion target: FaceRegion similarity: float
This way, it is clear which bounding boxes and keypoints are associated to which image in the test sample.