Merge in RR/vidocp from poly_to_rects_segmentation to master
Squashed commit of the following:
commit 3dffe067ef0bb4796eab22007eb6970b29f47822
Author: Matthias Bisping <matthias.bisping@iqser.com>
Date: Sat Feb 5 16:10:28 2022 +0100
readme updated
commit 448517205259134a8427b48d86d0d5331b726487
Author: Matthias Bisping <matthias.bisping@iqser.com>
Date: Sat Feb 5 16:09:35 2022 +0100
restructured dirs
commit 058c2971631c71d520b1a94ea75e249f9234ad87
Author: Matthias Bisping <matthias.bisping@iqser.com>
Date: Sat Feb 5 15:57:08 2022 +0100
renaming
commit 4e64a3d07f1dad76775955639157ec7b60e6ad38
Author: Matthias Bisping <matthias.bisping@iqser.com>
Date: Sat Feb 5 15:46:03 2022 +0100
readme updated
commit 728bedb13a2769b4652fd674ef26988efebcc7dc
Author: Matthias Bisping <matthias.bisping@iqser.com>
Date: Sat Feb 5 15:33:42 2022 +0100
added DVC
commit e2d5594afd6683d8207007d3a85d178dd0a3e546
Author: Matthias Bisping <matthias.bisping@iqser.com>
Date: Sat Feb 5 14:49:09 2022 +0100
renaming
27 lines
847 B
Python
27 lines
847 B
Python
import argparse
|
|
|
|
from vidocp.table_parsig import annotate_tables_in_pdf
|
|
from vidocp.redaction_detection import annotate_boxes_in_pdf
|
|
from vidocp.layout_detection import annotate_layout_in_pdf
|
|
|
|
|
|
def parse_args():
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument("pdf_path")
|
|
parser.add_argument("page_index", type=int)
|
|
parser.add_argument("--type", choices=["table", "redaction", "layout"], default="table")
|
|
|
|
args = parser.parse_args()
|
|
|
|
return args
|
|
|
|
|
|
if __name__ == "__main__":
|
|
args = parse_args()
|
|
if args.type == "table":
|
|
annotate_tables_in_pdf(args.pdf_path, page_index=args.page_index)
|
|
elif args.type == "redaction":
|
|
annotate_boxes_in_pdf(args.pdf_path, page_index=args.page_index)
|
|
elif args.type == "layout":
|
|
annotate_layout_in_pdf(args.pdf_path, page_index=args.page_index)
|