Source code for luna_handlers.classes.schemas.simple_schemas

"""
Module contains simple schemas for multiple usage
"""

from pydantic import conlist

from classes.schemas import types
from classes.schemas.base_schema import BaseSchema
from classes.schemas.types import Int01
from crutches_on_wheels.cow.pydantic.types import OptionalNotNullable


[docs] class BoundingBoxSchema(BaseSchema): """Bounding box schema""" # bounding box x coordinate x: types.SDKInt # bounding box y coordinate y: types.SDKInt # bounding box width width: types.SDKInt # bounding box height height: types.SDKInt
[docs] class UrlWithFaceBbox(BaseSchema): """Url with face bounding boxes schema""" # url url: str # face bounding box list faceBoundingBoxes: conlist(BoundingBoxSchema, min_length=1) = OptionalNotNullable() # is vl detections or not trustedDetections: Int01 = OptionalNotNullable()
[docs] class UrlBboxSchema(UrlWithFaceBbox): """Url with face and body bounding boxes schema""" # body bounding box list bodyBoundingBoxes: conlist(BoundingBoxSchema, min_length=1) = OptionalNotNullable()