Skip to content

Commit 225ff53

Browse files
Merge pull request #9 from Unstructured-IO/chore/update-from-upstream
chore: update from upstream PaddlePaddle/PaddleOCR
2 parents aa5e040 + 41d5bc1 commit 225ff53

File tree

1,149 files changed

+68126
-42112
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,149 files changed

+68126
-42112
lines changed

.clang_format.hook

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
#!/bin/bash
22
set -e
33

4-
readonly VERSION="3.8"
4+
readonly VERSION="13.0.0"
55

66
version=$(clang-format -version)
77

8+
if ! [[ $(python -V 2>&1 | awk '{print $2}' | awk -F '.' '{print $1$2}') -ge 36 ]]; then
9+
echo "clang-format installation by pip need python version great equal 3.6,
10+
please change the default python to higher version."
11+
exit 1
12+
fi
13+
814
if ! [[ $version == *"$VERSION"* ]]; then
9-
echo "clang-format version check failed."
10-
echo "a version contains '$VERSION' is needed, but get '$version'"
11-
echo "you can install the right version, and make an soft-link to '\$PATH' env"
12-
exit -1
15+
# low version of pip may not have the source of clang-format whl
16+
pip install --upgrade pip
17+
pip install clang-format==13.0.0
1318
fi
1419

1520
clang-format $@

.github/ISSUE_TEMPLATE/bug.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: 🐞 Bug
3+
about: Bug
4+
title: ''
5+
labels: 'Bug'
6+
assignees: ''
7+
8+
---
9+
10+
11+
#### 问题描述 / Problem Description
12+
13+
14+
#### 运行环境 / Runtime Environment
15+
- OS:
16+
- Paddle:
17+
- PaddleOCR:
18+
19+
#### 复现代码 / Reproduction Code
20+
21+
22+
#### 完整报错 / Complete Error Message
23+
24+
25+
#### 可能解决方案 / Possible solutions
26+
27+
28+
#### 附件 / Appendix

.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: 🙏 Q&A
4+
url: https://github.com/PaddlePaddle/PaddleOCR/discussions/categories/q-a
5+
about: Ask the community for help
6+
- name: 💡 Feature requests and ideas
7+
url: https://github.com/PaddlePaddle/PaddleOCR/discussions/categories/ideas
8+
about: Share ideas for new features
9+
- name: 🙌 Show and tell
10+
url: https://github.com/PaddlePaddle/PaddleOCR/discussions/categories/show-and-tell
11+
about: Show off something you've made

.github/ISSUE_TEMPLATE/custom.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

.github/workflows/codestyle.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: PaddleOCR Code Style Check
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: ['main', 'release/*']
7+
8+
jobs:
9+
check-code-style:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
ref: ${{ github.ref }}
15+
- uses: actions/setup-python@v5
16+
with:
17+
python-version: '3.10'
18+
# Install Dependencies for Python
19+
- name: Install Dependencies for Python
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install "clang-format==13.0.0"
23+
- uses: pre-commit/[email protected]
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Upload Python Package
10+
11+
on:
12+
release:
13+
types: [published]
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
deploy:
20+
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Set up Python
26+
uses: actions/setup-python@v4
27+
with:
28+
python-version: '3.x'
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install build
33+
pip install setuptools
34+
pip install wheel
35+
- name: Build package
36+
run: python -m build
37+
- name: Publish package
38+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
39+
with:
40+
user: __token__
41+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/tests.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: PaddleOCR PR Tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches: ["main", "release/*"]
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
test-pr:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Set up Python 3.10
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.10"
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install pytest
25+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
26+
pip install paddlepaddle==0.0.0 -f https://www.paddlepaddle.org.cn/whl/linux/cpu-mkl/develop.html
27+
pip install -e .
28+
- name: Test with pytest
29+
run: |
30+
pytest --verbose tests/

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ paddleocr.egg-info/
3131
/deploy/android_demo/app/.cxx/
3232
/deploy/android_demo/app/cache/
3333
test_tipc/web/models/
34-
test_tipc/web/node_modules/
34+
test_tipc/web/node_modules/

.pre-commit-config.yaml

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,22 @@
1-
- repo: https://github.com/PaddlePaddle/mirrors-yapf.git
2-
sha: 0d79c0c469bab64f7229c9aca2b1186ef47f0e37
3-
hooks:
4-
- id: yapf
5-
files: \.py$
1+
repos:
62
- repo: https://github.com/pre-commit/pre-commit-hooks
7-
sha: a11d9314b22d8f8c7556443875b731ef05965464
3+
rev: v4.6.0
84
hooks:
5+
- id: check-added-large-files
6+
args: ['--maxkb=512']
7+
- id: check-case-conflict
98
- id: check-merge-conflict
109
- id: check-symlinks
1110
- id: detect-private-key
12-
files: (?!.*paddle)^.*$
1311
- id: end-of-file-fixer
14-
files: \.md$
1512
- id: trailing-whitespace
16-
files: \.md$
13+
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|py|md)$
1714
- repo: https://github.com/Lucas-C/pre-commit-hooks
18-
sha: v1.0.1
15+
rev: v1.5.1
1916
hooks:
20-
- id: forbid-crlf
21-
files: \.md$
2217
- id: remove-crlf
23-
files: \.md$
24-
- id: forbid-tabs
25-
files: \.md$
2618
- id: remove-tabs
27-
files: \.md$
19+
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|py|md)$
2820
- repo: local
2921
hooks:
3022
- id: clang-format
@@ -33,3 +25,21 @@
3325
entry: bash .clang_format.hook -i
3426
language: system
3527
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|cuh|proto)$
28+
# For Python files
29+
- repo: https://github.com/psf/black.git
30+
rev: 24.4.2
31+
hooks:
32+
- id: black
33+
files: (.*\.(py|pyi|bzl)|BUILD|.*\.BUILD|WORKSPACE)$
34+
35+
# Flake8
36+
- repo: https://github.com/pycqa/flake8
37+
rev: 7.0.0
38+
hooks:
39+
- id: flake8
40+
args:
41+
- --count
42+
- --select=E9,F63,F7,F82,E721
43+
- --show-source
44+
- --statistics
45+
exclude: ^benchmark/|^test_tipc/

PPOCRLabel/Makefile

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)