Spaces:
Runtime error
Runtime error
| from abc import ABC, abstractmethod | |
| import numpy as np | |
| from typing import List, Dict, Any | |
| class OCRBackend(ABC): | |
| """Base class for OCR backends.""" | |
| async def initialize(self): | |
| """Initialize the OCR model.""" | |
| pass | |
| def detect(self, image: np.ndarray) -> List[Dict]: | |
| """Detect text in an image.""" | |
| pass | |
| class ObjectDetector(ABC): | |
| """Base class for object detectors.""" | |
| async def initialize(self): | |
| """Initialize the object detection model.""" | |
| pass | |
| def detect(self, image: np.ndarray) -> List[Dict]: | |
| """Detect objects in an image.""" | |
| pass |