leaf_focus/ocr/command.py
def ocr_prepare_many(config_file: Path):
    """Prepare multiple images for OCR."""

    if not config_file:
        raise click.UsageError("Must provide config file.")

    click.secho("Starting ocr prepare many.", bold=True)

    config = Config.load(config_file)
    processing_dir = config.processing_dir
    threshold = config.prepare_image_threshold

    logger = logging.getLogger()
    log_data = {"base_dir": str(processing_dir), "threshold": threshold}
    log_msg = ", ".join([f"{k}={v}" for k, v in log_data.items()])
    logger.info(f"Running ocr prepare many using {log_msg}.")

    c = Construct()
    c.run_ocr(base_dir=processing_dir, threshold=threshold)
    click.secho("Finished ocr prepare many.", bold=True)
Prepare multiple images for OCR.
Prepare multiple images for OCR.
Prepare multiple images for OCR .
def ocr_prepare_many(config_file: Path):
    if not config_file:
        raise click.UsageError("Must provide config file.")
    click.secho("Starting ocr prepare many.", bold=True)
    config = Config.load(config_file)
    processing_dir = config.processing_dir
    threshold = config.prepare_image_threshold
    logger = logging.getLogger()
    log_data = {"base_dir": str(processing_dir), "threshold": threshold}
    log_msg = ", ".join([f"{k}={v}" for k, v in log_data.items()])
    logger.info(f"Running ocr prepare many using {log_msg}.")
    c = Construct()
    c.run_ocr(base_dir=processing_dir, threshold=threshold)
    click.secho("Finished ocr prepare many.", bold=True)
def ocr_prepare_many ( config_file : Path ) : if not config_file : raise click . UsageError ( "Must provide config file." ) click . secho ( "Starting ocr prepare many." , bold = True ) config = Config . load ( config_file ) processing_dir = config . processing_dir threshold = config . prepare_image_threshold logger = logging . getLogger ( ) log_data = { "base_dir" : str ( processing_dir ) , "threshold" : threshold } log_msg = ", " . join ( [ f"{k}={v}" for k , v in log_data . items ( ) ] ) logger . info ( f"Running ocr prepare many using {log_msg}." ) c = Construct ( ) c . run_ocr ( base_dir = processing_dir , threshold = threshold ) click . secho ( "Finished ocr prepare many." , bold = True )
Prepare multiple images for OCR.
Prepare multiple images for OCR .
"""Prepare multiple images for OCR."""
config_file
Path