Skip to content

Fix incorrect image dimension handling in rotation logic#124

Open
sushantkhemalapure wants to merge 5 commits intohumanai-foundation:mainfrom
sushantkhemalapure:fix/image-rotation-dimensions
Open

Fix incorrect image dimension handling in rotation logic#124
sushantkhemalapure wants to merge 5 commits intohumanai-foundation:mainfrom
sushantkhemalapure:fix/image-rotation-dimensions

Conversation

@sushantkhemalapure
Copy link
Copy Markdown

Issue

The code incorrectly unpacks image.shape[:2] as (width, height), while OpenCV returns (height, width).

Fix

Updated the unpacking to correctly assign height and width.

Impact

  • Fixes distorted rotation output
  • Ensures correct image transformations

Files Updated

  • main.py
  • process_app.py
  • splitter_app.py

Testing

  • Tested rotation with sample images
  • Verified output dimensions are correct

- Updated TrOCR model path from ../../weights to ../../models
- Ensures correct model loading instead of CRAFT weights
- Corrected unpacking of image.shape[:2] to (height, width)
- Prevents distortion in rotated images
@sushantkhemalapure
Copy link
Copy Markdown
Author

Thanks for taking a look. Let me know if any changes are needed and I’ll update it quickly.

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