INNER CODE UNIT · Python

_validate_image

wiltodelta/remove-ai-watermarks · src/remove_ai_watermarks/cli.py:119

def _validate_image(path: Path) -> Path:
    if not path.exists():
        console.print(f"Error: File not found: {path}")
        raise SystemExit(1)
    if not is_supported_format(path):
        console.print(f"Warning: {path.suffix} may not be supported (expected: {', '.join(SUPPORTED_FORMATS)})")
    return path


def _resolved_strength_for_display(
    source: Path,
    strength: float | None,
    vendor: str | None,
    pipeline: str,
) -> float:
    """Resolve the same profile-specific strength the engine will execute.

    One call for every profile, so the printed value cannot drift from the executed

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…