Spaces:
Sleeping
Sleeping
File size: 705 Bytes
3e0197a 1cc9d18 433e762 3e0197a 5dba600 9a5d190 5dba600 9a5d190 5dba600 9a5d190 5dba600 3e0197a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
import pandas as pd
import gradio as gr
import easyocr
reader = easyocr.Reader(['en'])
title = 'Aadhaar'
description= '## Demo app to extract text data from photo of an Indian Aadhaar card. Uses EasyOCR library. Just a PoC. Tested only on photo in example'
def data(Aadhaar):
result = reader.readtext(Aadhaar,detail=0)
df=pd.DataFrame(result)
o1=df.iloc[3].item()
o2=df.iloc[4].item()
#o3=df.iloc[5].item()
o4=df.iloc[6].item()
o5=df.iloc[7].item()
#o6=df.iloc[8].item()
o7=df.iloc[9].item()
o8=df.iloc[10].item()
return o1,o2,o4,o5,o7,o8
demo = gr.Interface(data,gr.Image(),'text', title =title, description =description,examples=[['image.png']])
demo.launch() |