This commit is contained in:
Matthias Bisping 2022-02-06 14:25:44 +01:00
parent c9780a57e5
commit 504cafbd5d
2 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@ import argparse
from vidocp.table_parsing import annotate_tables_in_pdf
from vidocp.redaction_detection import annotate_boxes_in_pdf
from vidocp.layout_parsing import annotate_layout_in_pdf
from vidocp.figure_detection import remove_text_in_pdf
from vidocp.figure_detection import detect_figures_in_pdf
def parse_args():
@ -26,4 +26,4 @@ if __name__ == "__main__":
elif args.type == "layout":
annotate_layout_in_pdf(args.pdf_path, page_index=args.page_index)
elif args.type == "figure":
remove_text_in_pdf(args.pdf_path, page_index=args.page_index)
detect_figures_in_pdf(args.pdf_path, page_index=args.page_index)

View File

@ -93,7 +93,7 @@ def detect_figures(image: np.array):
return rects
def remove_text_in_pdf(pdf_path, page_index=1):
def detect_figures_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)