Coder Social home page Coder Social logo

go-ocr's Introduction

Go Ocr

基于chineseocr_lite的golang实现的ocr。

具体来说使用chineseocr_lite的OcrLiteOnnx 项目,参考xmcy001122 增加ocr.h和ocr.cpp,导出c风格函数,提供给ocr_wrapper.go使用cgo进行调用

使用

docker run --name ocr --rm -d -p 8080:8080 xsdhy/go-ocr:1.0

接口文档

识别接口

请求

参数 类型 是否必填 说明
image_url string 图片地址和base64二选一
image_base_64 string 图片地址和base64二选一
need_block bool 否,默认为false
curl --location 'http://127.0.0.1:8080/api/ocr' \
--header 'Content-Type: application/json' \
--data '{
    "image_url":"图片地址"
}'

响应

{
    "code": 200,
    "msg": "ok",
    "data": {
        "texts": [
            "第一行识别结果",
            "第二行识别结果",
            "第三行识别结果",
        ]
    }
}

识别接口(表单)

支持图片上传文件,接口地址为/api/ocr_file,文件key为file,其余的和识别接口相同

go-ocr's People

Contributors

xsdhy avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.