diff --git a/scripts/annotate.py b/scripts/annotate.py index 682b8ad..9ef1bce 100644 --- a/scripts/annotate.py +++ b/scripts/annotate.py @@ -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": diff --git a/vidocp/redaction_detection.py b/vidocp/redaction_detection.py index 1843f60..3362dc6 100644 --- a/vidocp/redaction_detection.py +++ b/vidocp/redaction_detection.py @@ -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)