File size: 417 Bytes
c6abe34
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
from abc import ABC, abstractmethod
from typing import List, Optional
from app.stat_import.schemas import RawOCRBlock

class OCRProvider(ABC):
    @abstractmethod
    def extract_blocks(self, image_bytes: bytes, **kwargs) -> List[RawOCRBlock]:
        """
        Extract bounding boxes and text from an image.
        Returns a list of RawOCRBlock containing the coordinates and confidence.
        """
        pass