sudhir2016 commited on
Commit
5dba600
1 Parent(s): 33a81e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -8
app.py CHANGED
@@ -3,15 +3,18 @@ import gradio as gr
3
  import easyocr
4
  reader = easyocr.Reader(['en'])
5
  title = 'Aadhaar'
6
- description= '## Demo app to extract name, DOB, gender and Card number from photo of an Indian Aadhaar card. Uses EasyOCR library. Just an example. Tested only on one sample'
7
  def data(Aadhaar):
8
  result = reader.readtext(Aadhaar,detail=0)
9
  df=pd.DataFrame(result)
10
- o1=df.iloc[7].item()
11
- o2=df.iloc[9].item()
12
- o3=df.iloc[12].item()
13
- o4=df.iloc[13].item()
14
- return o1,o2,o3,o4
15
- #return df
16
- demo = gr.Interface(data,gr.Image(),'text', title =title, description =description)
 
 
 
17
  demo.launch()
 
3
  import easyocr
4
  reader = easyocr.Reader(['en'])
5
  title = 'Aadhaar'
6
+ description= '## Demo app to extract text data from photo of an Indian Aadhaar card. Uses EasyOCR library. Just an PoC. Tested only on photo in example'
7
  def data(Aadhaar):
8
  result = reader.readtext(Aadhaar,detail=0)
9
  df=pd.DataFrame(result)
10
+ o1=df.iloc[3].item()
11
+ o2=df.iloc[4].item()
12
+ o3=df.iloc[5].item()
13
+ o4=df.iloc[6].item()
14
+ o5=df.iloc[7].item()
15
+ o6=df.iloc[8].item()
16
+ o7=df.iloc[9].item()
17
+ o8=df.iloc[10].item()
18
+ return o1,o2,o3,o4,o5,o6,o7,o8
19
+ demo = gr.Interface(data,gr.Image(),'text', title =title, description =description,examples=[['image.png']])
20
  demo.launch()