Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Introduce Image format options in CLI. Silence the tqdm downloading messages. #544

Merged
merged 5 commits into from
Dec 9, 2024

Conversation

nikos-livathinos
Copy link
Collaborator

This is a fix to:

  • Introduce format options in the docling CLI for Image with the same pipeline_options as for PDF. This allows the CLI parameters to be applied in case of image inputs.
  • Add RapidOcrOptions to the Union of ocr_options for PdfPipelineOptions.
  • Silence the tqdm messages during the downloading of model files.

Issues resolved by this Pull Request:
Resolves #505 #208

Checklist:

  • Documentation has been updated, if necessary.
  • Examples have been added, if necessary.
  • Tests have been added, if necessary.

…ine_options.

Add RapidOcrOptions to the Union of ocr_options for PdfPipelineOptions

Signed-off-by: Nikos Livathinos <[email protected]>
Copy link

mergify bot commented Dec 8, 2024

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

Signed-off-by: Nikos Livathinos <[email protected]>
# Disable tqdm prints used by HF
from tqdm import tqdm

tqdm.__init__ = partialmethod(tqdm.__init__, disable=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nikos-livathinos nikos-livathinos marked this pull request as ready for review December 9, 2024 13:48
@cau-git
Copy link
Contributor

cau-git commented Dec 9, 2024

Maybe one more check to do is, if the input format is an image, OCR must be activated for its pipeline options (independent of the global OCR choice)

@cau-git cau-git merged commit 78f61a8 into main Dec 9, 2024
9 checks passed
@cau-git cau-git deleted the nli/fix_ocr_options branch December 9, 2024 14:57
lucas-morin pushed a commit to lucas-morin/docling that referenced this pull request Dec 10, 2024
…ing messages. (DS4SD#544)

* fix: main: Introduce format options for Image with the same pdf pipeline_options.
Add RapidOcrOptions to the Union of ocr_options for PdfPipelineOptions

Signed-off-by: Nikos Livathinos <[email protected]>

* fix: Silence the tqdm messages during the downloading of model files

Signed-off-by: Nikos Livathinos <[email protected]>

* fix: Code styling

Signed-off-by: Nikos Livathinos <[email protected]>

* fix: Use the HF API to disable the tqdm progress bars

Signed-off-by: Nikos Livathinos <[email protected]>

---------

Signed-off-by: Nikos Livathinos <[email protected]>
cau-git pushed a commit that referenced this pull request Dec 17, 2024
…ing messages. (#544)

* fix: main: Introduce format options for Image with the same pdf pipeline_options.
Add RapidOcrOptions to the Union of ocr_options for PdfPipelineOptions

Signed-off-by: Nikos Livathinos <[email protected]>

* fix: Silence the tqdm messages during the downloading of model files

Signed-off-by: Nikos Livathinos <[email protected]>

* fix: Code styling

Signed-off-by: Nikos Livathinos <[email protected]>

* fix: Use the HF API to disable the tqdm progress bars

Signed-off-by: Nikos Livathinos <[email protected]>

---------

Signed-off-by: Nikos Livathinos <[email protected]>
Signed-off-by: Christoph Auer <[email protected]>
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.

Missing rapidocr option in actual code, and tesseract is not tesseract if JPGs
3 participants