improve the OCR pipeline processing and outputs formatting
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user