refactoring

This commit is contained in:
Matthias Bisping 2022-02-06 14:54:53 +01:00
parent e652da1fa8
commit 36a62a13e5
2 changed files with 3 additions and 3 deletions

View File

@ -1,7 +1,7 @@
import argparse
from vidocp.table_parsing import annotate_tables_in_pdf
from vidocp.redaction_detection import annotate_boxes_in_pdf
from vidocp.redaction_detection import annotate_redactions_in_pdf
from vidocp.layout_parsing import annotate_layout_in_pdf
from vidocp.figure_detection import detect_figures_in_pdf
@ -22,7 +22,7 @@ if __name__ == "__main__":
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)
annotate_redactions_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)
elif args.type == "figure":

View File

@ -30,7 +30,7 @@ def find_redactions(image: np.array, min_normalized_area=200000):
return contours
def annotate_boxes_in_pdf(pdf_path, page_index=1):
def annotate_redactions_in_pdf(pdf_path, page_index=1):
page = pdf2image.convert_from_path(pdf_path, first_page=page_index + 1, last_page=page_index + 1)[0]
page = np.array(page)