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 overflow in SegDetectorRepresenter and get_transformed_region #704

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

dmMaze
Copy link
Contributor

@dmMaze dmMaze commented Sep 5, 2024

I came across this image of 1280x45890, all detectors failed because of some post-processing overflow and OCR also failed due to the overflow in cv2.warpPerspective. This PR fixes it so the text in this image can be detected and recognized like an image with normal size.

But upon saving the result

result.paste(Image.fromarray(img), mask = alpha_ch)

could potentially eat up all memory, I have to close some programs to get it done on my win11 laptop with 32GB, but I'll leave the optimization to others.

Test case:
https://github.com/user-attachments/assets/4b22b2d9-d2f0-402f-80d2-5cc6b7c0db0f

@zyddnys zyddnys merged commit 37bb4cd into zyddnys:main Sep 18, 2024
0 of 2 checks passed
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.

2 participants