Tudu-Dev commited on
Commit
6bd422a
·
verified ·
1 Parent(s): f821cc0

Update Main.py

Browse files

added the main app method and get

Files changed (1) hide show
  1. main.py +16 -0
main.py CHANGED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastapi import FastAPI, UploadFile, File, HTTPException
2
+ from fastapi.middleware.cors import CORSMiddleware
3
+ import easyocr
4
+ import re
5
+ import shutil
6
+ import os
7
+ import uuid
8
+
9
+ app = FastAPI()
10
+
11
+ app.add_middleware(CORSMiddleware, allow_origins=["*"], allow_methods=["*"], allow_headers=["*"])
12
+ reader = easyocr.Reader(['en'], gpu=False)
13
+
14
+ @app.get("/")
15
+ def home():
16
+ return {"status": "online", 'message':"UPI OCR API is running"}