File size: 428 Bytes
6bd422a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from fastapi import FastAPI, UploadFile, File, HTTPException
from fastapi.middleware.cors import CORSMiddleware
import easyocr
import re
import shutil
import os 
import uuid 

app = FastAPI()

app.add_middleware(CORSMiddleware, allow_origins=["*"], allow_methods=["*"], allow_headers=["*"])
reader = easyocr.Reader(['en'], gpu=False)

@app.get("/")
def home():
    return {"status": "online", 'message':"UPI OCR API is running"}