Skip to content

Fix qapp.py import to work outside Docker environment#125

Open
sushantkhemalapure wants to merge 6 commits intohumanai-foundation:mainfrom
sushantkhemalapure:fix/qapp-import-path
Open

Fix qapp.py import to work outside Docker environment#125
sushantkhemalapure wants to merge 6 commits intohumanai-foundation:mainfrom
sushantkhemalapure:fix/qapp-import-path

Conversation

@sushantkhemalapure
Copy link
Copy Markdown

Issue

qapp.py imports the CRAFT module directly without adjusting sys.path, unlike app_streamlit.py. This causes import errors when running outside Docker.

Fix

Added sys.path setup similar to app_streamlit.py to ensure the CRAFT module is discoverable.

Impact

  • Allows qapp.py to run in local environments
  • Improves consistency across app entry points

Testing

  • Ran qapp.py locally
  • Verified imports work without Docker setup

- 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
- Added sys.path handling to locate CRAFT module
- Ensures qapp.py runs consistently outside Docker
@sushantkhemalapure
Copy link
Copy Markdown
Author

This change aligns qapp.py with app_streamlit.py so it can run outside Docker. Let me know if you'd prefer a different approach.

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