playreel/backend/models/analysis.py

32 lines
704 B
Python

from dataclasses import dataclass
from PIL import Image
from pydantic import BaseModel
from models.motion import MotionPlan
class MotionChoice(BaseModel):
"""검수 화면의 토글 하나. on이 꺼진 것은 VLM이 확신하지 못해 탈락시킨 요소다."""
key: str
label: str
what: str
on: bool
class FixedLayer(BaseModel):
key: str
label: str
on: bool = True
@dataclass
class PosterAnalysis:
grid: Image.Image # 사람이 요소를 지목하는 격자
movable: list[MotionChoice]
fixed: list[FixedLayer]
model: str
ip_risk: bool
has_qr: bool
plan: MotionPlan # 사람이 고르기 전의 VLM 제안 원본