Spaces:
Running on Zero
Running on Zero
| from abc import ABC, abstractmethod | |
| from typing import Dict, Any | |
| from PIL import Image | |
| class VisionEngine(ABC): | |
| """Abstract interface for vision models.""" | |
| def load(self): | |
| """Load the vision model into memory.""" | |
| pass | |
| def describe_scene(self, image: Image.Image, detailed: bool = False) -> str: | |
| """Generate a description of the scene.""" | |
| pass | |
| def read_text(self, image: Image.Image) -> str: | |
| """Perform OCR and return formatted text.""" | |
| pass | |
| def analyze(self, image: Image.Image, task: str) -> str: | |
| """Run a raw generic analysis task on the image.""" | |
| pass | |