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