min area size of text region passes as an argument for machine based reading order

pull/18/head
vahidrezanezhad 7 months ago
parent 29ddd4d909
commit 356da4cc53

@ -116,22 +116,28 @@ def image_enhancement(dir_imgs, dir_out_images, dir_out_labels, scales):
@click.option( @click.option(
"--input_height", "--input_height",
"-ih", "-ih",
help="input_height", help="input height",
) )
@click.option( @click.option(
"--input_width", "--input_width",
"-iw", "-iw",
help="input_width", help="input width",
)
@click.option(
"--min_area_size",
"-min",
help="min area size of regions considered for reading order training.",
) )
def machine_based_reading_order(dir_xml, dir_out_modal_image, dir_out_classes, input_height, input_width): def machine_based_reading_order(dir_xml, dir_out_modal_image, dir_out_classes, input_height, input_width, min_area_size):
xml_files_ind = os.listdir(dir_xml) xml_files_ind = os.listdir(dir_xml)
input_height = int(input_height) input_height = int(input_height)
input_width = int(input_width) input_width = int(input_width)
min_area = float(min_area_size)
indexer_start= 0#55166 indexer_start= 0#55166
max_area = 1 max_area = 1
min_area = 0.0001 #min_area = 0.0001
for ind_xml in tqdm(xml_files_ind): for ind_xml in tqdm(xml_files_ind):
indexer = 0 indexer = 0

Loading…
Cancel
Save