GithubHelp home page GithubHelp logo

xjl-le / lgpma_infer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from swhl/lgpma_infer

0.0 0.0 0.0 1.64 MB

表格结构识别LGPMA推理

License: Apache License 2.0

Shell 0.01% C++ 2.72% Python 97.26%

lgpma_infer's Introduction

来源于: DAVAR-Lab-OCR

模型下载

环境搭建

  • mmdet: 因为仓库中已经有了mmdet离线包,该包是下载的2.25.0,为了可以转onnx,里面做了一些修改,不影响现在的推理
  • 其他库安装:
    pip install -r requirements.txt -i https://pypi.douban.com/simple/

demo运行

python test_pub.py

# 输出结果,会在output目录下保存绘制框线的图像
# OK

模型转onnx

  • 状态:可以成功转换,转换时也特别耗费内存-_-!,同时因基于ONNXRuntime推理时,太耗费内存,而放弃
  • 转换脚本:
    bash model_2_onnx.sh
  • 转换之后onnx模型下载link,仅供参考,推理尚未成功
  • 验证推理代码:
    # 在davarocr/davar_common/apis/inference.py#L119行插入
    import onnxruntime
    session = onnxruntime.InferenceSession('lgpma.onnx')
    input_name = session.get_inputs()[0].name
    inputs = {
        input_name: data['img'][0].numpy().astype(np.float32)
    }
    outs = session.run(None, inputs)

参考链接

lgpma_infer's People

Contributors

swhl 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.