From 35214014025ea980819d690a8f629f95b5dbd303 Mon Sep 17 00:00:00 2001 From: Renato Durrer Date: Thu, 4 Apr 2024 17:27:48 +0200 Subject: [PATCH] fix dependencies. --- src/stratigraphy/line_detection.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/stratigraphy/line_detection.py b/src/stratigraphy/line_detection.py index cf1e1da7..66e8fdbd 100644 --- a/src/stratigraphy/line_detection.py +++ b/src/stratigraphy/line_detection.py @@ -101,7 +101,9 @@ def draw_lines_on_page(filename: str, page: fitz.Page, geometric_lines: list[Lin """ if not mlflow_tracking: logger.warning("MLFlow tracking is not enabled. MLFLow is required to store the images.") - import mlflow - img = plot_lines(page, geometric_lines, scale_factor=line_detection_params["pdf_scale_factor"]) - mlflow.log_image(img, f"pages/{filename}_page_{page.number + 1}_lines.png") + else: + import mlflow + + img = plot_lines(page, geometric_lines, scale_factor=line_detection_params["pdf_scale_factor"]) + mlflow.log_image(img, f"pages/{filename}_page_{page.number + 1}_lines.png")