Spaces:
Runtime error
Runtime error
Update app.py
Browse files38 unmodified lines39404142434445464748495038 unmodified lines# collect the results in the dictionary:textdic_easyocr = {}for idx in range(len(result)):pred_coor = result[idx][0]pred_text = result[idx][1]pred_confidence = result[idx][2]if(pred_confidence>0.6):textdic_easyocr[pred_text] = {}textdic_easyocr[pred_text]['location'] = pred_coortextdic_easyocr[pred_text]['pred_confidence'] = pred_confidence# create a data frame which shows the predicted text and prediction confidence38 unmodified lines39404142434445464748495051525338 unmodified lines# collect the results in the dictionary:textdic_easyocr = {}for idx in range(len(result)):x_coords = [point[0] for point in pred_coor]y_coords = [point[1] for point in pred_coor]center_x = sum(x_coords) / len(x_coords)center_y = sum(y_coords) / len(y_coords)pred_text = result[idx][1]pred_confidence = result[idx][2]if(pred_confidence>0.3):textdic_easyocr[pred_text] = {}textdic_easyocr[pred_text]['location'] = (center_x, center_y)textdic_easyocr[pred_text]['pred_confidence'] = pred_confidence# create a data frame which shows the predicted text and prediction confidence
app.py+6-3