Spaces:
Running on Zero
Running on Zero
File size: 750 Bytes
88fe4e7 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | from abc import ABC, abstractmethod
from typing import Dict, Any
from PIL import Image
class VisionEngine(ABC):
"""Abstract interface for vision models."""
@abstractmethod
def load(self):
"""Load the vision model into memory."""
pass
@abstractmethod
def describe_scene(self, image: Image.Image, detailed: bool = False) -> str:
"""Generate a description of the scene."""
pass
@abstractmethod
def read_text(self, image: Image.Image) -> str:
"""Perform OCR and return formatted text."""
pass
@abstractmethod
def analyze(self, image: Image.Image, task: str) -> str:
"""Run a raw generic analysis task on the image."""
pass
|