refactoring
This commit is contained in:
parent
e652da1fa8
commit
36a62a13e5
@ -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":
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user