Skip to content

Commit

Permalink
fixed: machine based reading order cause tuple index out of range err…
Browse files Browse the repository at this point in the history
…or if number of textregion is one.
  • Loading branch information
vahidrezanezhad committed Dec 4, 2024
1 parent 6aad006 commit 871d7bf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/eynollah/eynollah.py
Original file line number Diff line number Diff line change
Expand Up @@ -4013,7 +4013,10 @@ def do_order_of_regions_with_machine_optimized_algorithm(self,contours_only_text
inference_bs = 3
input_1= np.zeros( (inference_bs, height1, width1,3))
starting_list_of_regions = []
starting_list_of_regions.append( list(range(labels_con.shape[2])) )
if len(co_text_all)<=1:
starting_list_of_regions.append( list(range(1)) )
else:
starting_list_of_regions.append( list(range(labels_con.shape[2])) )
index_update = 0
index_selected = starting_list_of_regions[0]
#print(labels_con.shape[2],"number of regions for reading order")
Expand Down

0 comments on commit 871d7bf

Please sign in to comment.