leaf_focus/pipeline/prefect_flow/construct.py
def build_ocr(self, base_dir: Path):
        """Build the ocr Prefect flow."""

        with Flow("leaf-focus") as flow:
            threshold = Parameter("threshold")

            pcf_image_task = PdfImagesLoadTask(base_dir)
            pdf_image_items = pcf_image_task()

            ocr_prepare_task = OcrPrepareTask(base_dir)
            ocr_prepare_task.map(
                input_item=pdf_image_items,
                threshold=unmapped(threshold),
            )

            # NOTE: Cannot run OCR as part of the Prefect flow.
            # ocr_recognise_task = OcrRecogniseTask(base_dir)
            # ocr_recognise_task.map(
            #     input_item=ocr_prepare_items,
            #     threshold=unmapped(threshold),
            #     ocr_wrapper=ocr_resource,
            # )

        return flow
Build the ocr Prefect flow.
Build the ocr Prefect flow.
Build the ocr Prefect flow .
def build_ocr(self, base_dir: Path):
        with Flow("leaf-focus") as flow:
            threshold = Parameter("threshold")
            pcf_image_task = PdfImagesLoadTask(base_dir)
            pdf_image_items = pcf_image_task()
            ocr_prepare_task = OcrPrepareTask(base_dir)
            ocr_prepare_task.map(
                input_item=pdf_image_items,
                threshold=unmapped(threshold),
            )
        return flow
def build_ocr ( self , base_dir : Path ) : with Flow ( "leaf-focus" ) as flow : threshold = Parameter ( "threshold" ) pcf_image_task = PdfImagesLoadTask ( base_dir ) pdf_image_items = pcf_image_task ( ) ocr_prepare_task = OcrPrepareTask ( base_dir ) ocr_prepare_task . map ( input_item = pdf_image_items , threshold = unmapped ( threshold ) , ) return flow
Build the ocr Prefect flow.
Build the ocr Prefect flow .
"""Build the ocr Prefect flow.""" # NOTE: Cannot run OCR as part of the Prefect flow. # ocr_recognise_task = OcrRecogniseTask(base_dir) # ocr_recognise_task.map( #     input_item=ocr_prepare_items, #     threshold=unmapped(threshold), #     ocr_wrapper=ocr_resource, # )
self
base_dir
Path