Skip to content

Instantly share code, notes, and snippets.

View imiraoui's full-sized avatar
😀
Data Enthusiast

Ilias Miraoui imiraoui

😀
Data Enthusiast
  • New York, NY
View GitHub Profile
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