MohitGupta41
Initial Project commit
bd7254f
raw
history blame contribute delete
846 Bytes
# models/face.py
from pydantic import BaseModel, Field
from typing import List, Optional
class EnrollResp(BaseModel):
users: List[str] = Field(default_factory=list)
total_vectors: int
class IdentifyReq(BaseModel):
image_b64: str
top_k: int = 3
class IdentifyHit(BaseModel):
user: str
score: float
class IdentifyResp(BaseModel):
decision: str
best_score: float
margin: float
topk: List[IdentifyHit]
bbox: Optional[List[int]] = None
class FaceDet(BaseModel):
bbox: List[int]
decision: str
best_score: float
margin: float
topk: List[IdentifyHit] = Field(default_factory=list)
class IdentifyManyReq(BaseModel):
image_b64: str
top_k: int = 3
top_k_db: Optional[int] = None
class IdentifyManyResp(BaseModel):
detections: List[FaceDet] = Field(default_factory=list)