code
stringlengths
3
6.57k
process_dfs(temp_df)
temp_df.text.notnull()
temp_df.iterrows()
str(row['text'])
temp_dict1.append(temp_dict2)
process_dfs_updated(temp_df,language,psm_val,image)
temp_df.text.notnull()
len(temp_df)
temp_df.iterrows()
print(row["top"],row["height"],row["left"],row["width"])
int(row["top"])
int(row["top"]+row["height"])
int(row["left"])
int(row["left"]+row["width"])
pytesseract.image_to_data(crop_image,config='--psm '+str(psm)
df2.text.notnull()
len(temp_df2)
print("old text", row['text'])
print("new text", org_text)
str(org_text)
temp_dict1.append(temp_dict2)
check_psm(path,coord,language,mode_height,save_base_path,psm_val,org_score,org_text,line_text,org_conf)
get_text(path,coord,language,mode_height,save_base_path,psm)
text.split()
join(text_list)
seq_matcher(text,line_text)
get_text(path,coord,language,mode_height,save_base_path,psm_val)
path.split('upload')
download_file(download_url,headers,path,f_type='image')
np.frombuffer(image, np.uint8)
cv2.imdecode(nparr, cv2.IMREAD_COLOR)
cv2.imread("/home/naresh/crop.jpeg",0)
bound_coordinate(coord[0] , width)
bound_coordinate(coord[1],height )
bound_coordinate(coord[2] ,width)
bound_coordinate(coord[3], height)
abs(right-left)
abs(bottom-top)
get_image_from_box(image, coord, height=abs(coord[0,1]-coord[2,1])
str(psm_val)
str(uuid.uuid4()
cv2.imwrite(save_path,crop_image)
abs(bottom-top)
print(LANG_MAPPING[language][0])
abs(coord[1,1]-coord[2,1])
pytesseract.image_to_string(crop_image,config='--psm 6', lang=LANG_MAPPING[language][1])
pytesseract.image_to_data(crop_image,config='--psm 6', lang=LANG_MAPPING[language][0],output_type=Output.DATAFRAME)
process_dfs(dfs)
process_dfs_updated(dfs,language,6,crop_image)
pytesseract.image_to_string(crop_image,config='--psm '+str(psm_val)
pytesseract.image_to_data(crop_image,config='--psm '+str(psm_val)
process_dfs(dfs)
process_dfs_updated(dfs,language,psm_val,crop_image)
print("xxxxxxxxxxxxxxxxxxxxxxxxxx",coord)
print([0.0])
merger_text(line)
enumerate(line['regions'])
word.keys()
replace(" ", "")
get_coord(bbox)
temp_box.append([bbox["boundingBox"]['vertices'][0]['x'],bbox["boundingBox"]['vertices'][0]['y']])
temp_box.append([bbox["boundingBox"]['vertices'][1]['x'],bbox["boundingBox"]['vertices'][1]['y']])
temp_box.append([bbox["boundingBox"]['vertices'][2]['x'],bbox["boundingBox"]['vertices'][2]['y']])
temp_box.append([bbox["boundingBox"]['vertices'][3]['x'],bbox["boundingBox"]['vertices'][3]['y']])
temp_box_cv.append(bbox["boundingBox"]['vertices'][0]['x'])
temp_box_cv.append(bbox["boundingBox"]['vertices'][0]['y'])
temp_box_cv.append(bbox["boundingBox"]['vertices'][2]['x'])
temp_box_cv.append(bbox["boundingBox"]['vertices'][2]['y'])
np.array(temp_box)
frequent_height(page_info)
len(page_info)
enumerate(page_info)
get_coord(level)
len(coord)
text_height.append(abs(coord[3]-coord[1])
Counter(text_height)
occurence_count.most_common(1)
remove_space(a)
a.replace(" ", "")
seq_matcher(tgt_text,gt_text)
remove_space(tgt_text)
remove_space(gt_text)
SequenceMatcher(None, gt_text, tgt_text)
ratio()
levenshtein(tgt_text, gt_text)
abs(len(gt_text)
len(gt_text)
list(SequenceMatcher(None, gt_text, tgt_text)
get_matching_blocks()
len(gt_text)
len(tgt_text)
len(gt_text)
len(tgt_text)
len(gt_text)
len(tgt_text)
count_mismatch_char(gt ,tgt)
len(gt)
zip(gt,tgt)
abs(gt_count-count)
correct_region(region)