GithubHelp home page GithubHelp logo

Comments (5)

ErikBoesen avatar ErikBoesen commented on August 23, 2024

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.

FASTANDEXTREME avatar FASTANDEXTREME commented on August 23, 2024

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.

ErikBoesen avatar ErikBoesen commented on August 23, 2024

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.

FASTANDEXTREME avatar FASTANDEXTREME commented on August 23, 2024

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.

ErikBoesen avatar ErikBoesen commented on August 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.