This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from modal import Image, Mount, Stub, asgi_app, gpu, method | |
from PIL import Image as Image2 | |
from typing import List | |
from io import BytesIO | |
from fastapi import FastAPI, Request | |
from surya.model.detection.segformer import load_model as load_det_model, load_processor as load_det_processor | |
from surya.model.recognition.model import load_model as load_rec_model | |
from surya.model.recognition.processor import load_processor as load_rec_processor | |
from surya.ocr import run_ocr | |
import base64 |