File size: 818 Bytes
0695d15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python3
"""
Entry point for running the mnemo OCR pipeline.

Usage:
    python run.py
    python run.py --config configs/config.yaml
"""

import argparse
from pathlib import Path

from src.config_loader import load_config
from src.pipeline import process_all_images_to_excel


def main():
    parser = argparse.ArgumentParser(description="Run OCR pipeline.")
    parser.add_argument(
        "--config",
        type=str,
        default="configs/config.yaml",
        help="Path to configuration YAML file",
    )

    args = parser.parse_args()

    config_path = Path(args.config)
    if not config_path.exists():
        raise FileNotFoundError(f"Config file not found: {config_path}")

    cfg = load_config(config_path)
    process_all_images_to_excel(cfg)


if __name__ == "__main__":
    main()