Skip to content

Comments

Image upload and Image analysis#36

Open
SharmiladeviP wants to merge 2 commits intomainfrom
Sharmila-1
Open

Image upload and Image analysis#36
SharmiladeviP wants to merge 2 commits intomainfrom
Sharmila-1

Conversation

@SharmiladeviP
Copy link
Collaborator

I have added code for file attachment and a image decoding code.

@rootbid rootbid changed the title Sharmila 1 Image upload and Image analysis Jun 25, 2025
@rootbid rootbid requested a review from Copilot June 25, 2025 05:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds file attachment functionality to the UI and implements image decoding and OCR-based text extraction with confidence scoring.

  • Updated the UI columns to include a file uploader and manual upload trigger.
  • Introduced new OCR utility functions for image-to-text conversion and confidence scoring.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/ui.py Updated UI layout to include file upload and file decoding functionality.
src/ocr_utils.py Added OCR utility functions to support image analysis and text extraction.
Comments suppressed due to low confidence (1)

src/ui.py:561

  • The try-except block for file decoding appears to have inconsistent indentation. Ensure that the statements following 'try:', 'except', and 'else' are correctly indented to avoid syntax errors.
                    try:

config = self.get_ocr_config()

# Call the enhanced OCR function
extracted_text = advanced_image_to_text(self.image_path, language, config)
Copy link

Copilot AI Jun 25, 2025

Choose a reason for hiding this comment

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

The function 'advanced_image_to_text' is defined without a 'self' parameter yet is called as if it were an instance method. Consider defining it as a static method or invoking it with 'self.advanced_image_to_text'.

Suggested change
extracted_text = advanced_image_to_text(self.image_path, language, config)
extracted_text = self.advanced_image_to_text(self.image_path, language, config)

Copilot uses AI. Check for mistakes.
QMessageBox.warning(self, "Warning", "Please select an image first!")
return

confidence_data = get_text_with_confidence(self.image_path)
Copy link

Copilot AI Jun 25, 2025

Choose a reason for hiding this comment

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

The function 'get_text_with_confidence' is defined without a 'self' parameter but is invoked as if it were an instance method. Consider defining it as a static method or calling 'self.get_text_with_confidence' instead.

Copilot uses AI. Check for mistakes.
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