-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
760 additions
and
105,775 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
name: 🐞 Bug | ||
about: Bug | ||
title: 'Bug' | ||
labels: 'Bug' | ||
assignees: '' | ||
|
||
--- | ||
|
||
请提供下述完整信息以便快速定位问题 | ||
(Please provide the following information to quickly locate the problem) | ||
- **系统环境/System Environment**: | ||
- **使用的是哪门语言的程序/Which programing language**: | ||
- **使用当前库的版本/Use version**: | ||
- **可复现问题的demo和文件/Demo of reproducible problems**: | ||
- **完整报错/Complete Error Message**: | ||
- **可能的解决方案/Possible solutions**: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
blank_issues_enabled: false | ||
contact_links: | ||
- name: ❓ Questions | ||
url: https://github.com/RapidAI/TableStructureRec/discussions/categories/q-a | ||
about: Please use the community forum for help and questions regarding ProcessLaTeXFormulaTools Docs | ||
- name: 💡 Feature requests and ideas | ||
url: https://github.com/RapidAI/TableStructureRec/discussions/new?category=feature-requests | ||
about: Please vote for and post new feature ideas in the community forum | ||
- name: 📖 Documentation | ||
url: https://rapidai.github.io/TableStructureRec/docs/ | ||
about: A great place to find instructions and answers about RapidOCR. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Push rapid_unwrap to pypi | ||
|
||
on: | ||
push: | ||
tags: | ||
- rapid_unwrap_v* | ||
|
||
jobs: | ||
UnitTesting: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Pull latest code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
architecture: 'x64' | ||
|
||
- name: Display Python version | ||
run: python -c "import sys; print(sys.version)" | ||
|
||
- name: Unit testings | ||
run: | | ||
pip install -r requirements.txt | ||
pip install pytest | ||
pytest tests/test_uvdoc.py | ||
GenerateWHL_PushPyPi: | ||
needs: UnitTesting | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
architecture: 'x64' | ||
|
||
- name: Run setup.py | ||
run: | | ||
pip install -r requirements.txt | ||
python -m pip install --upgrade pip | ||
pip install wheel get_pypi_latest_version | ||
python setup_uvdoc.py bdist_wheel "${{ github.ref_name }}" | ||
- name: Publish distribution 📦 to PyPI | ||
uses: pypa/[email protected] | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
packages_dir: dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
/output/ | ||
/rapid_unwrap/models/*.onnx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
repos: | ||
- repo: https://gitee.com/SWHL/autoflake | ||
rev: v2.1.1 | ||
hooks: | ||
- id: autoflake | ||
args: | ||
[ | ||
"--recursive", | ||
"--in-place", | ||
"--remove-all-unused-imports", | ||
"--remove-unused-variable", | ||
"--ignore-init-module-imports", | ||
] | ||
files: \.py$ | ||
- repo: https://gitee.com/SWHL/black | ||
rev: 23.1.0 | ||
hooks: | ||
- id: black | ||
files: \.py$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<div align="center"> | ||
<div align="center"> | ||
<h1><b>📊RapidUnWrap</b></h1> | ||
</div> | ||
<a href=""><img src="https://img.shields.io/badge/Python->=3.8,<3.13-aff.svg"></a> | ||
<a href=""><img src="https://img.shields.io/badge/OS-Linux%2C%20Mac%2C%20Win-pink.svg"></a> | ||
<a href="https://semver.org/"><img alt="SemVer2.0" src="https://img.shields.io/badge/SemVer-2.0-brightgreen"></a> | ||
<a href="https://github.com/psf/black"><img src="https://img.shields.io/badge/code%20style-black-000000.svg"></a> | ||
<a href="https://github.com/RapidAI/TableStructureRec/blob/c41bbd23898cb27a957ed962b0ffee3c74dfeff1/LICENSE"><img alt="GitHub" src="https://img.shields.io/badge/license-Apache 2.0-blue"></a> | ||
</div> | ||
|
||
### 最近更新 | ||
|
||
- **2024.11.15** | ||
- 完成初版代码,转换 [UVDoc](https://github.com/tanguymagne/UVDoc) 模型为onnx,完善前后处理 | ||
|
||
|
||
### 简介 | ||
|
||
本仓库用于进行文档扭曲的修正,同时能一定程度缓解透视和旋转问题 | ||
|
||
|
||
### 在线体验 | ||
[modelscope](https://www.modelscope.cn/studios/jockerK/DocUnwrap) | ||
### 效果展示 | ||
![res_show.jpg](preview.jpg) | ||
|
||
### 安装 | ||
``` python {linenos=table} | ||
# 建议使用清华源安装 https://pypi.tuna.tsinghua.edu.cn/simple | ||
pip install rapid-unwrap | ||
``` | ||
|
||
### 快速使用 | ||
|
||
``` python {linenos=table} | ||
import cv2 | ||
|
||
from inference import DocUnwrapper | ||
img_path = "img/demo4.jpg" | ||
doc_unwrapper = DocUnwrapper(img_path) | ||
unwrapped_img, elapse = doc_unwrapper(img_path) | ||
print(f"doc unwrap elapse:{elapse}") | ||
cv2.imwrite("unwarped.png", unwrapped_img) | ||
|
||
``` | ||
|
||
|
||
### 致谢 | ||
|
||
[UVDoc](https://github.com/tanguymagne/UVDoc) | ||
|
||
|
||
### 贡献指南 | ||
|
||
欢迎提交请求。对于重大更改,请先打开issue讨论您想要改变的内容。 | ||
|
||
有其他的好建议和集成场景,作者也会积极响应支持 | ||
|
||
### 开源许可证 | ||
|
||
该项目采用[Apache 2.0](https://github.com/RapidAI/TableStructureRec/blob/c41bbd23898cb27a957ed962b0ffee3c74dfeff1/LICENSE) | ||
开源许可证。 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
import cv2 | ||
|
||
from uvdocpredictor import UVDocPredictor | ||
if __name__ == '__main__': | ||
|
||
img_path = "img/demo1.png" | ||
model_path = "model/uvdoc.onnx" | ||
predictor = UVDocPredictor(model_path) | ||
unwrapped_img = predictor(img_path) | ||
unwrapped_img = cv2.cvtColor(unwrapped_img, cv2.COLOR_RGB2BGR) | ||
cv2.imwrite("output/unwarped.png", unwrapped_img) | ||
from rapid_unwrap.inference import DocUnwrapper | ||
img_path = "img/demo.jpg" | ||
doc_unwrapper = DocUnwrapper(img_path) | ||
unwrapped_img, elapse = doc_unwrapper(img_path) | ||
print(f"doc unwrap elapse:{elapse}") | ||
cv2.imwrite("unwarped.png", unwrapped_img) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.