|
|
@ -67,6 +67,12 @@ from qurator.eynollah.eynollah import Eynollah
|
|
|
|
is_flag=True,
|
|
|
|
is_flag=True,
|
|
|
|
help="If set, will plot intermediary files and images",
|
|
|
|
help="If set, will plot intermediary files and images",
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
@click.option(
|
|
|
|
|
|
|
|
"--extract_only_images/--disable-extracting_only_images",
|
|
|
|
|
|
|
|
"-eoi/-noeoi",
|
|
|
|
|
|
|
|
is_flag=True,
|
|
|
|
|
|
|
|
help="If a directory is given, only images in documents will be cropped and saved there and the other processing will not be done",
|
|
|
|
|
|
|
|
)
|
|
|
|
@click.option(
|
|
|
|
@click.option(
|
|
|
|
"--allow-enhancement/--no-allow-enhancement",
|
|
|
|
"--allow-enhancement/--no-allow-enhancement",
|
|
|
|
"-ae/-noae",
|
|
|
|
"-ae/-noae",
|
|
|
@ -148,6 +154,7 @@ def main(
|
|
|
|
save_layout,
|
|
|
|
save_layout,
|
|
|
|
save_deskewed,
|
|
|
|
save_deskewed,
|
|
|
|
save_all,
|
|
|
|
save_all,
|
|
|
|
|
|
|
|
extract_only_images,
|
|
|
|
save_page,
|
|
|
|
save_page,
|
|
|
|
enable_plotting,
|
|
|
|
enable_plotting,
|
|
|
|
allow_enhancement,
|
|
|
|
allow_enhancement,
|
|
|
@ -175,12 +182,16 @@ def main(
|
|
|
|
if textline_light and not light_version:
|
|
|
|
if textline_light and not light_version:
|
|
|
|
print('Error: You used -tll to enable light textline detection but -light is not enabled')
|
|
|
|
print('Error: You used -tll to enable light textline detection but -light is not enabled')
|
|
|
|
sys.exit(1)
|
|
|
|
sys.exit(1)
|
|
|
|
|
|
|
|
if extract_only_images and not ( save_images and enable_plotting):
|
|
|
|
|
|
|
|
print('Error: You used -eoi to enable extract images only mode but did not enable plotting with -ep and providing an output directory with -si')
|
|
|
|
|
|
|
|
sys.exit(1)
|
|
|
|
eynollah = Eynollah(
|
|
|
|
eynollah = Eynollah(
|
|
|
|
image_filename=image,
|
|
|
|
image_filename=image,
|
|
|
|
dir_out=out,
|
|
|
|
dir_out=out,
|
|
|
|
dir_in=dir_in,
|
|
|
|
dir_in=dir_in,
|
|
|
|
dir_models=model,
|
|
|
|
dir_models=model,
|
|
|
|
dir_of_cropped_images=save_images,
|
|
|
|
dir_of_cropped_images=save_images,
|
|
|
|
|
|
|
|
extract_only_images=extract_only_images,
|
|
|
|
dir_of_layout=save_layout,
|
|
|
|
dir_of_layout=save_layout,
|
|
|
|
dir_of_deskewed=save_deskewed,
|
|
|
|
dir_of_deskewed=save_deskewed,
|
|
|
|
dir_of_all=save_all,
|
|
|
|
dir_of_all=save_all,
|
|
|
|