Giter Site home page Giter Site logo

ddddocr-for-java's Introduction

ddddocr-for-java

AUR Java Maven

基于sml2h3开源的ddddocr构建的java开源项目。源项目只提供pypi版本,不能满足java开发者的需求,特此尝试开发本项目。

基本使用

目前只支持了ddddocr的OCR功能,使用了common_old.onnx模型。可以通过mvn install安装项目或者使用github packages源,并添加maven依赖。

   <repositories>
        <repository>
            <id>github</id>
            <url>https://maven.pkg.github.com/gcs-zhn/ddddocr-for-java</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>
    <dependencies>
       <dependency>
           <groupId>top.gcszhn</groupId>
           <artifactId>d4ocr</artifactId>
           <version>1.0</version>
       </dependency>
    </dependencies>

同时github的maven registry要求登录认证,即只允许github用户下载,不像maven**仓库无需注册即可下载。具体配置有官方文档,主要是在settings.xml中配置server,注意token不是登录密码,需要自行创建,快捷链接

  <servers>
      <server>
      <id>github</id>
      <username>你的github账号</username>
      <password>你的github创建的具有下载package权限的token</password>
    </server>
   </servers>

下面是简单的示例代码

import java.awt.image.BufferedImage;

import top.gcszhn.d4ocr.OCREngine;
import top.gcszhn.d4ocr.utils.IOUtils;

public class Test {
    public static void main(String[] args) {
         OCREngine engine = OCREngine.instance();
         BufferedImage image = IOUtils.read("AENZ.png");
         String predict = engine.recognize(image);
         System.out.println(predict);
    }
}

声明

模型版权归原作者sml2h3所有,仅供学习交流使用,任何问题欢迎发issue。

温馨提示

编译版本使用java 11编译,字节码版本号为55,低版本java使用会报错,可以选择克隆本项目手动打包或者升级java(PS:java都17了,别坚守java 1.8了)。

ddddocr-for-java's People

Contributors

gcs-zhn 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.