Skip to content

Instantly share code, notes, and snippets.

@zachmayer
zachmayer / onnx.py
Last active June 7, 2024 22:03
Export surya layout model to ONNX
# Copyright 2024 AI INSIGHT SOLUTIONS INC.
import timeit
from pathlib import Path
import numpy as np
import onnx
import onnxruntime as rt
import torch
from onnxruntime.quantization import QuantType, quantize_dynamic
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
@CurtisHumphrey
CurtisHumphrey / packages.md
Last active October 15, 2018 15:39
Sublime Text 3
  • Babel
  • Case Conversion
  • CSS Extended Completions
  • DocBlockr
  • EditorConfig
  • ESLint-Formatter
  • GitGutter
  • Hex to HSL Color Converter
  • HTML-CSS-JS Prettify
  • JsFormat