Source code for luna_handlers.classes.schemas.multipart

"""
Module contains schemas for multipart requests
"""
from pydantic import conlist

from classes.schemas.base_schema import BaseSchema
from classes.schemas.simple_schemas import BoundingBoxSchema
from classes.schemas.types import CustomDatetime, DetectTs, Str256


class _FileNameWithFaceBBs(BaseSchema):
    """Model for filename with face bounding boxes"""

    # filename string
    filename: str
    # face bounding box list
    faceBoundingBoxes: conlist(BoundingBoxSchema, min_items=1)


[docs]class FileNameWithFaceBBs(BaseSchema): """Model for filename with face bounding boxes""" # face bounding box list with filename faceBoundingBoxes: list[_FileNameWithFaceBBs]
class _FileNameWithBodyBBs(BaseSchema): """Model for filename with body bounding boxes""" # filename string filename: str # body bounding box list bodyBoundingBoxes: conlist(BoundingBoxSchema, min_items=1)
[docs]class FileNameWithBodyBBs(BaseSchema): """Model for filename with body bounding boxes""" # body bounding box list with filename bodyBoundingBoxes: list[_FileNameWithBodyBBs]
class _FileNameWithDetectionTime(BaseSchema): """Model for filename with image detect time""" # filename string filename: str # image detection time detectTime: CustomDatetime
[docs]class FileNameWithDetectionTime(BaseSchema): """Model for list of filename with image detect time""" # detection time list with filename imageDetectTime: list[_FileNameWithDetectionTime]
class _FileNameWithDetectionRelativeTimestamp(BaseSchema): """Model for filename with image detect relative timestamp""" # filename string filename: str # image detection relative timestamp detectTs: DetectTs
[docs]class FileNameWithDetectionRelativeTimestamp(BaseSchema): """Model for list of filename with image detect relative detection timestamp""" # detection relative timestamp list with filename imageDetectTs: list[_FileNameWithDetectionRelativeTimestamp]
class _FileNameWithImageOrigin(BaseSchema): """Model for filename with image origin""" # filename string filename: str # image origin imageOrigin: Str256
[docs]class FileNameWithImageOrigin(BaseSchema): """Model for list of filename with image origin""" # image origin list with filename imageOrigin: list[_FileNameWithImageOrigin]