adding space between splitted textline predicted text in the case of trocr

This commit is contained in:
vahidrezanezhad 2025-05-02 01:02:32 +02:00
parent 5c8084a397
commit fd375e15d5

View file

@ -5164,7 +5164,7 @@ class Eynollah_ocr:
extracted_texts = extracted_texts + generated_text_merged extracted_texts = extracted_texts + generated_text_merged
extracted_texts_merged = [extracted_texts[ind] if cropped_lines_meging_indexing[ind]==0 else extracted_texts[ind]+extracted_texts[ind+1] if cropped_lines_meging_indexing[ind]==1 else None for ind in range(len(cropped_lines_meging_indexing))] extracted_texts_merged = [extracted_texts[ind] if cropped_lines_meging_indexing[ind]==0 else extracted_texts[ind]+" "+extracted_texts[ind+1] if cropped_lines_meging_indexing[ind]==1 else None for ind in range(len(cropped_lines_meging_indexing))]
extracted_texts_merged = [ind for ind in extracted_texts_merged if ind is not None] extracted_texts_merged = [ind for ind in extracted_texts_merged if ind is not None]
#print(extracted_texts_merged, len(extracted_texts_merged)) #print(extracted_texts_merged, len(extracted_texts_merged))