Spaces:
Paused
Paused
Update Main.py
Browse filesadded the main app method and get
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"}
|