-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from Dv04/Dev
- Loading branch information
Showing
3 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from paddleocr import PaddleOCR | ||
|
||
# Initialize the PaddleOCR instance | ||
ocr = PaddleOCR() | ||
|
||
# Load and recognize text in the image | ||
result = ocr.ocr('dataset/Trial.png') | ||
|
||
# Process the recognition result | ||
recognized_text = [] | ||
for line in result[0]: | ||
line_text = ' '.join([word_info[-1] for word_info in line]) | ||
recognized_text.append(line_text) | ||
|
||
# Join the lines to form the final recognized text | ||
final_text = '\n'.join(recognized_text) | ||
|
||
print(final_text) |