update pyinfra
This commit is contained in:
parent
ca58f85642
commit
27fd7de39a
@ -1 +1 @@
|
|||||||
Subproject commit 4753c005ee926b09238977d524542f12ec4c4847
|
Subproject commit 9bb5a86310f065b852e16679cf37d5c939c0cacd
|
||||||
@ -2,6 +2,7 @@ import argparse
|
|||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
from glob import glob
|
from glob import glob
|
||||||
|
from operator import truth
|
||||||
|
|
||||||
from image_prediction.pipeline import load_pipeline
|
from image_prediction.pipeline import load_pipeline
|
||||||
from image_prediction.utils import get_logger
|
from image_prediction.utils import get_logger
|
||||||
@ -33,7 +34,7 @@ def process_pdf(pipeline, pdf_path, metadata=None, page_range=None):
|
|||||||
predictions = list(pipeline(f.read(), page_range=page_range, metadata_per_image=metadata))
|
predictions = list(pipeline(f.read(), page_range=page_range, metadata_per_image=metadata))
|
||||||
|
|
||||||
annotate_pdf(
|
annotate_pdf(
|
||||||
pdf_path, predictions, os.path.join("/tmp", os.path.basename(pdf_path.replace(".pdf", "_annotated.pdf")))
|
pdf_path, predictions, os.path.join("/tmp", os.path.basename(pdf_path.replace(".pdf", f"_{truth(metadata)}_annotated.pdf")))
|
||||||
)
|
)
|
||||||
|
|
||||||
return predictions
|
return predictions
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user