pragnakalp commited on
Commit
9065127
·
1 Parent(s): d0dba34

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -132,9 +132,9 @@ def generate_ocr(Method,img):
132
  if Method == 'PaddleOCR':
133
  text_output = ocr_with_paddle(img)
134
 
135
- new_data=img.reshape(img.shape)
136
- imge = Image.fromarray(new_data.astype(np.uint8),'RGB')
137
- add_csv = [Method,imge,text_output]
138
 
139
  with open(DATA_FILE, "a") as f:
140
  writer = csv.writer(f)
@@ -145,8 +145,6 @@ def generate_ocr(Method,img):
145
  print(commit_url)
146
  try:
147
  dataset = load_dataset("pragnakalp/OCR-img-to-text", data_files= "ocr_data.csv", streaming=True)
148
- dataset = load_dataset("pragnakalp/OCR-img-to-text/data", split="train")
149
- print("()()()()",dataset[0]["image"])
150
  print(dataset)
151
  except Exception as e:
152
  print("error in loading data",e)
 
132
  if Method == 'PaddleOCR':
133
  text_output = ocr_with_paddle(img)
134
 
135
+ # new_data=img.reshape(img.shape)
136
+ # imge = Image.fromarray(new_data.astype(np.uint8),'RGB')
137
+ add_csv = [Method,cv2.imwrite("myimage.jpg", img),text_output]
138
 
139
  with open(DATA_FILE, "a") as f:
140
  writer = csv.writer(f)
 
145
  print(commit_url)
146
  try:
147
  dataset = load_dataset("pragnakalp/OCR-img-to-text", data_files= "ocr_data.csv", streaming=True)
 
 
148
  print(dataset)
149
  except Exception as e:
150
  print("error in loading data",e)