improve the OCR pipeline processing and outputs formatting

This commit is contained in:
2026-07-19 19:54:53 +02:00
parent d375db47c3
commit 1cf1c6eeab
30 changed files with 3838 additions and 3900 deletions

View File

@@ -7,9 +7,7 @@ from pathlib import Path
from typing import Any
import nbformat
import platformdirs
from ocr_pipeline.config import settings
from ocr_pipeline.utils.logging import get_logger
logger = get_logger(__name__)
@@ -104,8 +102,11 @@ def migrate_notebook(notebook_path: Path, pipeline: Any) -> dict[str, Any]:
continue
logger.info("migrating_image", path=str(img_path))
pipeline.process_single(img_path)
results["processed"] += 1
output_files = pipeline.process_single(img_path)
if output_files:
results["processed"] += 1
else:
results["skipped"] += 1
except Exception as e:
logger.error("migration_failed", path=str(img_path), error=str(e))