from __future__ import annotations from enum import StrEnum from pydantic import BaseModel, Field class Detector(StrEnum): FACE = "face" ANIMAL = "animal" PERSON = "person" SUBJECT = "subject" class BoundingBoxResponse(BaseModel): x: int = Field(ge=0) y: int = Field(ge=0) w: int = Field(gt=0) h: int = Field(gt=0) class SourceSizeResponse(BaseModel): width: int = Field(gt=0) height: int = Field(gt=0) class FocusResponse(BaseModel): filename: str detector: Detector method: str buffer_ratio: float = Field(ge=0.0, le=0.6) detected_bbox: BoundingBoxResponse square_bbox: BoundingBoxResponse source_size: SourceSizeResponse mime_type: str crop_data_url: str annotated_data_url: str class HealthResponse(BaseModel): ok: bool = True env: str version: str docs_enabled: bool test_ui_enabled: bool auth_enabled: bool auth_header: str | None max_upload_bytes: int allowed_mime_types: list[str]