Skip to content

Align PDF inference image mode - #75

Open
CooperSheroy wants to merge 1 commit into
baidu:mainfrom
CooperSheroy:catalina/pdf-base-image-mode-20260723
Open

Align PDF inference image mode#75
CooperSheroy wants to merge 1 commit into
baidu:mainfrom
CooperSheroy:catalina/pdf-base-image-mode-20260723

Conversation

@CooperSheroy

Copy link
Copy Markdown

Summary

  • default batch inference to base image mode for PDF inputs
  • reject explicit --pdf with unsupported gundam image mode
  • update the README PDF example to use base

Validation

  • uv run --python 3.12 --with requests python -m py_compile infer.py
  • uv run --python 3.12 --with requests python - <<'PY'
    import sys
    import infer

sys.argv = ['infer.py', '--image_dir', 'images']
args = infer.parse_args()
print(f'image_dir_default={args.image_mode}')

sys.argv = ['infer.py', '--pdf', 'doc.pdf']
args = infer.parse_args()
print(f'pdf_default={args.image_mode}')

sys.argv = ['infer.py', '--pdf', 'doc.pdf', '--image_mode', 'gundam']
try:
infer.parse_args()
except SystemExit as exc:
print(f'pdf_gundam_exit={exc.code}')
else:
raise SystemExit('expected parser error')
PY

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant