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

@@ -44,6 +44,8 @@ def run(
engine: str | None = typer.Option(
None, "--engine", "-e", help="OCR engine (paddleocr/tesseract/auto)"
),
exclude: list[str] = typer.Option([], "--exclude", help="Glob pattern to exclude; repeatable"),
force: bool = typer.Option(False, "--force", help="Reprocess files already recorded as processed"),
):
"""Run OCR pipeline on all screenshots"""
if input_dir:
@@ -54,6 +56,10 @@ def run(
settings.processing.workers = workers
if engine:
settings.ocr.engine = engine
if exclude:
settings.input.exclude_patterns = exclude
if force:
settings.processing.skip_existing = False
pipeline = OCRPipeline()
result = pipeline.process_all()
@@ -136,7 +142,7 @@ def status():
def stats(days: int = typer.Option(30, "--days", "-d", help="Number of days to analyze")):
"""Show processing statistics"""
pipeline = OCRPipeline()
stats = pipeline.get_stats()
stats = pipeline.get_stats(days)
table = Table(title=f"Statistics (last {days} days)")
table.add_column("Metric", style="cyan")