Merge pull request #401 from Yaswanth820/master

Added extract_text_from_image script
This commit is contained in:
Bartick Maiti 2022-10-13 23:43:07 +05:30 committed by GitHub
commit 8689592a95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,16 @@
# Extract text from image
This script extracts text from an image using the EasyOCR library.
It can support multiple languages.
## Usage
1. Create a virtual environment
2. Install the requirements - `pip install -r requirements.txt`
3. Run the script - `python main.py`
## Output
Output will be printed to console.
Happy coding!!

View File

@ -0,0 +1,15 @@
import easyocr
gpu = False # if you want to use GPU, set gpu=True
languages = ['en'] # refer https://www.jaided.ai/easyocr/ for supporting languages
reader = easyocr.Reader(languages, gpu=gpu)
IMG_PATH = 'test1.png'
result = reader.readtext(IMG_PATH)
text = ''
for tup in result:
text += tup[1]
print(text)

View File

@ -0,0 +1 @@
easyocr==1.6.2

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB