Skip to content

Commit 3523939

Browse files
committed
chore: init commit
0 parents  commit 3523939

16 files changed

Lines changed: 904 additions & 0 deletions

.github/FUNDING.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# These are supported funding model platforms
2+
3+
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
13+
custom: https://rapidai.github.io/RapidOCRDocs/sponsor/

.github/ISSUE_TEMPLATE/bug.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: 🐞 Bug
3+
about: Bug
4+
title: 'Bug'
5+
labels: 'Bug'
6+
assignees: ''
7+
8+
---
9+
10+
#### 问题描述 / Problem Description
11+
12+
13+
#### 运行环境 / Runtime Environment
14+
15+
16+
#### 复现代码 / Reproduction Code
17+
```python
18+
19+
```
20+
21+
#### 可能解决方案 / Possible solutions

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: ❓ Questions
4+
url: https://github.com/RapidAI/RapidOCR/discussions/categories/q-a
5+
about: Please use the community forum for help and questions regarding RapidOCR.
6+
- name: 💡 Feature requests and ideas
7+
url: https://github.com/RapidAI/RapidOCR/discussions/categories/ideas
8+
about: Please vote for and post new feature ideas in the community forum.
9+
- name: 📖 Documentation
10+
url: https://rapidai.github.io/RapidOCRDocs/docs/
11+
about: A great place to find instructions and answers about RapidOCR.

.github/workflows/SyncToGitee.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: SyncToGitee
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
repo-sync:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout source codes
11+
uses: actions/checkout@v4
12+
13+
- name: Mirror the Github organization repos to Gitee.
14+
uses: Yikun/hub-mirror-action@v1.4
15+
with:
16+
src: 'github/RapidAI'
17+
dst: 'gitee/RapidAI'
18+
dst_key: ${{ secrets.GITEE_PRIVATE_KEY }}
19+
dst_token: ${{ secrets.GITEE_TOKEN }}
20+
force_update: true
21+
# only sync this repo
22+
static_list: "RapidOCR"
23+
debug: true
24+
25+
- name: Mirror the Github organization repos to Gitee.
26+
uses: Yikun/hub-mirror-action@v1.4
27+
with:
28+
src: 'github/RapidAI'
29+
dst: 'gitee/openKylin'
30+
dst_key: ${{ secrets.GITEE_PRIVATE_KEY }}
31+
dst_token: ${{ secrets.GITEE_TOKEN }}
32+
force_update: true
33+
# only sync this repo
34+
static_list: "RapidOCR"
35+
debug: true
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Push rapidocr_api to pypi
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
jobs:
9+
GenerateWHL_PushPyPi:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up Python 3.10
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: '3.10'
19+
architecture: 'x64'
20+
21+
- name: Set SSH Environment
22+
env:
23+
DEPLOY_KEYS: ${{ secrets.GEN_PYTHON_SDK }}
24+
run: |
25+
mkdir -p ~/.ssh/
26+
echo "$DEPLOY_KEYS" > ~/.ssh/id_rsa
27+
chmod 600 ~/.ssh/id_rsa
28+
chmod 700 ~/.ssh && chmod 600 ~/.ssh/*
29+
30+
- name: Run setup.py
31+
run: |
32+
cd api
33+
pip install -r requirements.txt
34+
pip install get_pypi_latest_version wheel
35+
36+
python -m pip install --upgrade pip
37+
python setup.py bdist_wheel "${{ github.event.head_commit.message }}"
38+
39+
- name: Publish distribution 📦 to PyPI
40+
uses: pypa/gh-action-pypi-publish@v1.5.0
41+
with:
42+
password: ${{ secrets.RAPIDOCR_API_PYPI }}
43+
packages_dir: api/dist/

.gitignore

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### Python template
3+
# Byte-compiled / optimized / DLL files
4+
__pycache__/
5+
*.py[cod]
6+
*$py.class
7+
.pytest_cache
8+
9+
# C extensions
10+
*.so
11+
12+
# Distribution / packaging
13+
.Python
14+
build/
15+
develop-eggs/
16+
dist/
17+
downloads/
18+
eggs/
19+
.eggs/
20+
lib/
21+
lib64/
22+
parts/
23+
sdist/
24+
var/
25+
wheels/
26+
pip-wheel-metadata/
27+
share/python-wheels/
28+
*.egg-info/
29+
.installed.cfg
30+
*.egg
31+
MANIFEST
32+
33+
# PyInstaller
34+
# Usually these files are written by a python script from a template
35+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
36+
# *.manifest
37+
# *.spec
38+
*.res
39+
40+
# Installer logs
41+
pip-log.txt
42+
pip-delete-this-directory.txt
43+
44+
# Unit test / coverage reports
45+
htmlcov/
46+
.tox/
47+
.nox/
48+
.coverage
49+
.coverage.*
50+
.cache
51+
nosetests.xml
52+
coverage.xml
53+
*.cover
54+
*.py,cover
55+
.hypothesis/
56+
.pytest_cache/
57+
58+
# Translations
59+
*.mo
60+
*.pot
61+
62+
# Django stuff:
63+
*.log
64+
local_settings.py
65+
db.sqlite3
66+
db.sqlite3-journal
67+
68+
# Flask stuff:
69+
instance/
70+
.webassets-cache
71+
72+
# Scrapy stuff:
73+
.scrapy
74+
75+
# Sphinx documentation
76+
docs/_build/
77+
78+
# PyBuilder
79+
target/
80+
81+
# Jupyter Notebook
82+
.ipynb_checkpoints
83+
84+
# IPython
85+
profile_default/
86+
ipython_config.py
87+
88+
# pyenv
89+
.python-version
90+
91+
# pipenv
92+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
94+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
95+
# install all needed dependencies.
96+
#Pipfile.lock
97+
98+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
99+
__pypackages__/
100+
101+
# Celery stuff
102+
celerybeat-schedule
103+
celerybeat.pid
104+
105+
# SageMath parsed files
106+
*.sage.py
107+
108+
# Environments
109+
.env
110+
.venv
111+
env/
112+
venv/
113+
ENV/
114+
env.bak/
115+
venv.bak/
116+
117+
# Spyder project settings
118+
.spyderproject
119+
.spyproject
120+
121+
# Rope project settings
122+
.ropeproject
123+
124+
# mkdocs documentation
125+
/site
126+
127+
# mypy
128+
.mypy_cache/
129+
.dmypy.json
130+
dmypy.json
131+
132+
# Pyre type checker
133+
.pyre/
134+
135+
#idea
136+
.vs
137+
.vscode
138+
.idea
139+
/images
140+
/models
141+
142+
#models
143+
*.onnx
144+
145+
*.ttf
146+
*.ttc
147+
148+
long1.jpg
149+
150+
*.bin
151+
*.mapping
152+
*.xml
153+
154+
*.pdiparams
155+
*.pdiparams.info
156+
*.pdmodel
157+
158+
.DS_Store
159+
*.npy

.pre-commit-config.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
repos:
2+
- repo: https://gitee.com/SWHL/autoflake
3+
rev: v2.1.1
4+
hooks:
5+
- id: autoflake
6+
args:
7+
[
8+
"--recursive",
9+
"--in-place",
10+
"--remove-all-unused-imports",
11+
"--ignore-init-module-imports",
12+
]
13+
files: \.py$
14+
- repo: https://gitee.com/SWHL/black
15+
rev: 23.1.0
16+
hooks:
17+
- id: black
18+
files: \.py$

Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM python:3.10.11-slim-buster
2+
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
5+
# 设置工作目录
6+
WORKDIR /app
7+
8+
# 安装vim,如果不需要临时修改容器文件,此步骤可以删
9+
RUN apt-get update && \
10+
apt-get install -y --no-install-recommends vim && \
11+
apt-get clean && \
12+
rm -rf /var/lib/apt/lists/*
13+
14+
RUN set -eux; \
15+
pip install --no-cache-dir rapidocr_api pillow rapidocr-onnxruntime==1.3.25 -i https://mirrors.aliyun.com/pypi/simple; \
16+
pip uninstall -y opencv-python; \
17+
pip install --no-cache-dir opencv-python-headless -i https://mirrors.aliyun.com/pypi/simple
18+
19+
EXPOSE 9003
20+
21+
CMD ["bash", "-c", "rapidocr_api -ip 0.0.0.0 -p 9003 -workers 2"]

0 commit comments

Comments
 (0)