Source code for luna_handlers.sdk.sdk_loop.models.body_sample
"""Module contains body sample models"""
from typing import List, Optional
import attr
from attr import dataclass
from lunavl.sdk.descriptors.descriptors import BodyDescriptor
from lunavl.sdk.detectors.bodydetector import BodyDetection
from lunavl.sdk.estimators.body_estimators.body_attributes import BodyAttributes
from lunavl.sdk.estimators.body_estimators.bodywarper import BodyWarpedImage
from .filtration.base import FiltrationResults
[docs]@dataclass(slots=True)
class BodySample:
"""Body attributes containers"""
# body detetction (None if origin is face warp)
detection: Optional[BodyDetection] = None
# body descriptor
descriptor: Optional[BodyDescriptor] = None
# body warp estimation
warp: Optional[BodyWarpedImage] = None
# body attributes estimation
attributes: Optional[BodyAttributes] = None
# filtration results
filters: FiltrationResults = attr.field(factory=FiltrationResults)
[docs]@dataclass(slots=True)
class AggregatedBodySample:
"""Aggregated body sample contaiter"""
# origin samples
samples: List[BodySample] = attr.field(factory=list)
# aggregated descriptor
descriptor: Optional[BodyDescriptor] = None
# aggregated body attributes
attributes: Optional[BodyAttributes] = None
# applied filters result
filters: FiltrationResults = attr.field(factory=FiltrationResults)