Comments (5)
You could accomplish this quite simply, as follows:
import ocrspace
api = ocrspace.API()
text = api.ocr_url(message.attachments[0].uri)
text
will now contain the text from the image.
from ocrspace.
I think by-default it uses OCR Engine-1 and I want to use 3 so it would be like this?
api = ocrspace.API()
OCREngine=3
text = api.ocr_url('https://upload.wikimedia.org/wikipedia/commons/8/8f/Arabic-script.png')
print(text)
i want to change engine as it seems current engine cannot support few languages. Also it does not auto detect the language it seems and only extract text from english text images. Is there way to extract text from image of any language that it supports?
from ocrspace.
Close:
api = ocrspace.API(OCREngine=3)
text = api.ocr_url('https://upload.wikimedia.org/wikipedia/commons/8/8f/Arabic-script.png')
print(text)
from ocrspace.
Close:
api = ocrspace.API(OCREngine=3) text = api.ocr_url('https://upload.wikimedia.org/wikipedia/commons/8/8f/Arabic-script.png') print(text)
it still cannot extract text from any other language that it support except english
from ocrspace.
Sorry, missed the second part of the question. You can specify your desired language as follows:
api = ocrspace.API(language=ocrspace.Language.Arabic, OCREngine=3)
text = api.ocr_url('https://upload.wikimedia.org/wikipedia/commons/8/8f/Arabic-script.png')
print(text)
See the full list of language options here: https://github.com/ErikBoesen/ocrspace/blob/master/ocrspace/main.py#L4-L28
from ocrspace.
Related Issues (11)
- Code runs with no errors but doesnt return any text? HOT 12
- license?
- Upload to PyPI HOT 1
- Directly return text HOT 2
- How to use the api.ocr_file() HOT 8
- Latest version not uploaded to pypy HOT 1
- no base-64 image support HOT 3
- Exception: Timed out waiting for results continually comes up HOT 1
- Add engine parameter to modify OCREngine payload property HOT 2
- OCREngine 2 and 3 does not work in docker HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ocrspace.