pragnakalp commited on
Commit
00bb0bd
1 Parent(s): 5ea74a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -131,17 +131,17 @@ def generate_ocr(Method,img):
131
  if Method == 'PaddleOCR':
132
  text_output = ocr_with_paddle(img)
133
 
 
 
 
 
134
  with open(DATA_FILE, "a") as csvfile:
135
  writer = csv.DictWriter(csvfile, fieldnames=["method", "image", "generated_text"])
136
  writer.writerow(
137
- {"method": Method, "image": img, "generated_text": text_output}
138
  )
139
  commit_url = repo.push_to_hub()
140
  print(commit_url)
141
- new_data=img.reshape(img.shape)
142
- print("^^^^^^^^^^^^^^^",new_data)
143
- imge = Image.fromarray(new_data.astype(np.uint8),'RGB')
144
- imge.show()
145
  # save_details(Method,text_output,img)
146
  # sender="[email protected]"
147
  # password="httscgatatbbxxur"
 
131
  if Method == 'PaddleOCR':
132
  text_output = ocr_with_paddle(img)
133
 
134
+ new_data=img.reshape(img.shape)
135
+ print("^^^^^^^^^^^^^^^",new_data)
136
+ imge = Image.fromarray(new_data.astype(np.uint8),'RGB')
137
+ # imge.show()
138
  with open(DATA_FILE, "a") as csvfile:
139
  writer = csv.DictWriter(csvfile, fieldnames=["method", "image", "generated_text"])
140
  writer.writerow(
141
+ {"method": Method, "image": imge, "generated_text": text_output}
142
  )
143
  commit_url = repo.push_to_hub()
144
  print(commit_url)
 
 
 
 
145
  # save_details(Method,text_output,img)
146
  # sender="[email protected]"
147
  # password="httscgatatbbxxur"