Skip to content

✨ support printing the OCR text in the CLI tool #239

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

Merged
merged 1 commit into from
May 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions mindee/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,11 @@ def call_parse(self) -> None:
else:
if response.document is None:
raise MindeeClientError("Something went wrong during async parsing.")
# print the OCR
if self.parsed_args.include_words:
print("#############\nDocument Text\n#############\n::\n")
print(" " + str(response.document.ocr).replace("\n", "\n "))
# print the response as rST
print(self._doc_str(self.parsed_args.output_type, response.document))

def _parse_sync(self) -> PredictResponse:
Expand Down
Loading