Spaces:
Sleeping
Sleeping
| from pydantic import BaseModel | |
| from typing import List, Dict, Any, Optional | |
| # ========================= | |
| # Pydantic Models | |
| # ========================= | |
| class Analysis(BaseModel): | |
| is_ai: bool | |
| ai_confidence: float | |
| class Attribute(BaseModel): | |
| type: str | |
| weight: float = 1.0 | |
| ai_confidence: float = 1.0 | |
| is_ai: bool = True | |
| parameters: List[Dict[str, Any]] = [] | |
| class Metadata(BaseModel): | |
| start_time: float = 0.0 | |
| end_time: float = 0.0 | |
| processing_time: float = 0.0 | |
| class ImageClassifierResult(BaseModel): | |
| analysis: Analysis | |
| attributes: List[Attribute] = [] | |
| metadata: Metadata | |
| # Request schema | |
| class ImageRequest(BaseModel): | |
| path: str | |
| type: Optional[str] = None # "url", "local_path", or "base64". Auto-detected if None. | |