-
Notifications
You must be signed in to change notification settings - Fork 100
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
GSSoC'24: OCR Detection #62
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Added functions to detect text and process data from the image
Removed verbose printing
Added detection from webcam livestream
Added full detected text display
Added mse function
Disabled reading as a paragraph
Fixed confidence bug
Updated the file to fit the requirements of text detection
@TAHIR0110 Please review the pull request, and let me know if changes are required or not. |
@TAHIR0110 Please also add the labels in the PR, the same that is mentioned in the issue. |
I would like to work on this, can you please assign this to me? |
@SAM-DEV007 I have merged it and labelled it as level3 instead of level1. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #56
The pull request for the OCR Detection resolving the feature enhancement.
OCR_Detection
The OCR Detection is introduced in order to help the victims in the situation where they can not use other means to communicate or seek help, other than
written communication shown to the camera. Also, it helps in detecting potential self-harm when the victim is in the process of writing the death note, and the
camera catches a glimpse of it and can use existing models to determine the scale of the threat that uses text as their primary input.
Usage
It is to be kept in mind that a window will only be created if there are text detected by the model. For visualizing another image, that window has to be closed in order for the another window to appear.
demo.py
to start the web camera for obtaining frames.Working
easyocr
package is used to provide image to text detection.Model_Data
contains the downloaded model to reduce the online dependancy.detect.py
contains the functions that can be imported by other scripts to be executed to perform image to text detection.demo.py
contains a demo code which showcases the functionality.OpenCV without GUI (
opencv-python-headless
) is used to optimize the script for detection. It is useful in optimizing the detection speed by removing useless processes used for GUI.Additionally, for web integration, GUI is not needed but the other functionalities remains the same.
demo.py
also contains an optimization which prevents the execution of the model detection if the frame difference is less, i.e., the frames hasn't changed much. MSE (Mean Squared Error) is used to calculate the difference between the two frame. The model only gets executed, if the error is greater than20
. This can be modified by changing the value ofERR_DIFF
.Multi-processing can be used to get seamless detections without delay.
Demo