first commit
Some checks are pending
Build/Publish Develop Docs / deploy (push) Waiting to run

This commit is contained in:
2025-07-02 08:57:16 +03:00
commit 56532cc9a9
1901 changed files with 457695 additions and 0 deletions

62
.github/ISSUE_TEMPLATE/bug-report.yml vendored Normal file
View File

@@ -0,0 +1,62 @@
# PaddleOCR
name: 🐛 Bug Report
description: Problems with PaddleOCR
body:
- type: markdown
attributes:
value: |
Thank you for submitting a PaddleOCR 🐛 Bug Report!
- type: checkboxes
attributes:
label: 🔎 Search before asking
description: >
Please search the PaddleOCR [Docs](https://paddlepaddle.github.io/PaddleOCR/), [Issues](https://github.com/PaddlePaddle/PaddleOCR/issues) and [Discussions](https://github.com/PaddlePaddle/PaddleOCR/discussions) to see if a similar bug report already exists.
options:
- label: I have searched the PaddleOCR [Docs](https://paddlepaddle.github.io/PaddleOCR/) and found no similar bug report.
required: true
- label: I have searched the PaddleOCR [Issues](https://github.com/PaddlePaddle/PaddleOCR/issues) and found no similar bug report.
required: true
- label: I have searched the PaddleOCR [Discussions](https://github.com/PaddlePaddle/PaddleOCR/discussions) and found no similar bug report.
required: true
- type: textarea
attributes:
label: 🐛 Bug (问题描述)
description: Provide console output with error messages and/or screenshots of the bug. (请提供详细报错信息或者截图)
placeholder: |
💡 ProTip! Include as much information as possible (screenshots, logs, tracebacks etc.) to receive the most helpful response.
validations:
required: true
- type: textarea
attributes:
label: 🏃‍♂️ Environment (运行环境)
description: Please specify the software and hardware you used to produce the bug. (请给出详细依赖包信息,便于复现问题)
placeholder: |
```bash
OS macOS-13.5.2
Environment Jupyter
Python 3.11.2
PaddleOCR 2.8.1
Install git
RAM 16.00 GB
CPU Apple M2
CUDA None
```
validations:
required: true
- type: textarea
attributes:
label: 🌰 Minimal Reproducible Example (最小可复现问题的Demo)
description: >
When asking a question, people will be better able to provide help if you provide code that they can easily understand and use to **reproduce** the problem.
This is referred to by community members as creating a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example). (请务必提供该Demo这样节省大家时间)
placeholder: |
```bash
# Code to reproduce your issue here
```
validations:
required: true

11
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: 🙏 Q&A
url: https://github.com/PaddlePaddle/PaddleOCR/discussions/categories/q-a
about: Ask the community for help
- name: 💡 Feature requests and ideas
url: https://github.com/PaddlePaddle/PaddleOCR/discussions/categories/ideas
about: Share ideas for new features
- name: 🙌 Show and tell
url: https://github.com/PaddlePaddle/PaddleOCR/discussions/categories/show-and-tell
about: Show off something you've made

13
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,13 @@
# Keep GitHub Actions up to date with GitHub's Dependabot...
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem
version: 2
updates:
- package-ecosystem: github-actions
directory: /
groups:
github-actions:
patterns:
- "*" # Group all Actions updates into a single larger pull request
schedule:
interval: weekly

View File

@@ -0,0 +1,31 @@
name: Build/Publish Develop Docs
on:
push:
branches:
- master
- main
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mike mkdocs-material jieba mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-static-i18n
- run: |
git fetch origin gh-pages --depth=1
mike deploy --push --update-aliases main latest

View File

@@ -0,0 +1,31 @@
name: Build/Publish Release Docs
on:
push:
tags:
- v*
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mike mkdocs-material jieba mkdocs-git-revision-date-localized-plugin mkdocs-git-committers-plugin-2 mkdocs-static-i18n
- run: |
git fetch origin gh-pages --depth=1
mike deploy --push "${{ github.ref_name }}"

View File

@@ -0,0 +1,23 @@
name: Close inactive issues
on:
schedule:
- cron: "30 1 * * *"
jobs:
close-issues:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v9
with:
days-before-issue-stale: 90
days-before-issue-close: 14
stale-issue-label: "stale"
stale-issue-message: "This issue is stale because it has been open for 90 days with no activity."
close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale."
days-before-pr-stale: -1
days-before-pr-close: -1
repo-token: ${{ secrets.GITHUB_TOKEN }}

36
.github/workflows/codestyle.yml vendored Normal file
View File

@@ -0,0 +1,36 @@
name: PaddleOCR Code Style Check
on:
pull_request:
push:
branches: ['main', 'release/*']
jobs:
check-code-style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Cache Python dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Dependencies for Python
run: |
python -m pip install --upgrade pip
pip install "clang-format==13.0.0"
- uses: pre-commit/action@v3.0.1
with:
extra_args: '--all-files'

39
.github/workflows/python-publish.yml vendored Normal file
View File

@@ -0,0 +1,39 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Upload Python Package
on:
release:
types: [published]
permissions:
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build==1.2.2
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

73
.github/workflows/test_gpu.yml vendored Normal file
View File

@@ -0,0 +1,73 @@
name: PaddleOCR PR Tests GPU
on:
push:
branches: ["main"]
paths-ignore:
- '**.md'
- '**.txt'
- '**.yml'
- '**.yaml'
pull_request:
branches: ["main"]
paths-ignore:
- '**.md'
- '**.txt'
- '**.yml'
- '**.yaml'
workflow_dispatch:
env:
PR_ID: ${{ github.event.pull_request.number }}
COMMIT_ID: ${{ github.event.pull_request.head.sha }}
work_dir: /workspace/PaddleOCR
PADDLENLP_ROOT: /workspace/PaddleOCR
TASK: paddleocr-CI-${{ github.event.pull_request.number }}
BRANCH: ${{ github.event.pull_request.base.ref }}
AGILE_COMPILE_BRANCH: ${{ github.event.pull_request.base.ref }}
DIR_NAME: ${{ github.repository }}
permissions:
contents: read
jobs:
test-pr-gpu:
runs-on: [self-hosted, GPU-2Card-OCR]
steps:
- name: run test
env:
py_version: "3.10"
paddle_whl: https://paddle-qa.bj.bcebos.com/paddle-pipeline/Develop-GpuSome-LinuxCentos-Gcc82-Cuda118-Cudnn86-Trt85-Py310-CINN-Compile/latest/paddlepaddle_gpu-0.0.0-cp310-cp310-linux_x86_64.whl
docker_image: ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddle:latest-dev-cuda11.8-cudnn8.6-trt8.5-gcc82
run: |
work_dir=$RANDOM
mkdir $work_dir
cd $work_dir
git clone --depth=1 https://github.com/PaddlePaddle/PaddleOCR.git -b main
cd PaddleOCR
git fetch origin pull/${PR_ID}/head:ci_build
git checkout ci_build
docker run --gpus all --rm -i --name PaddleOCR_CI_$RANDOM \
--shm-size=128g --net=host \
-v $PWD:/workspace -w /workspace \
-e "py_version=${py_version}" \
-e "paddle_whl=${paddle_whl}" \
${docker_image} /bin/bash -c '
ldconfig;
nvidia-smi
df -hl
echo ${py_version}
rm -rf run_env
mkdir run_env
ln -s $(which python${py_version}) run_env/python
ln -s $(which python${py_version}) run_env/python3
ln -s $(which pip${py_version}) run_env/pip
export PATH=$PWD/run_env:${PATH}
python -m pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/
python -c "import paddle; paddle.version.show()"
python -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
python -m pip install pytest
if [ -f requirements.txt ]; then python -m pip install -r requirements.txt; fi
python -m pip install -e .
python -m pytest --verbose tests/
'

53
.github/workflows/tests.yaml vendored Normal file
View File

@@ -0,0 +1,53 @@
name: PaddleOCR PR Tests
on:
push:
branches: ["main", "release/*"]
paths-ignore:
- '**.md'
- '**.txt'
- '**.yml'
- '**.yaml'
pull_request:
branches: ["main", "release/*"]
paths-ignore:
- '**.md'
- '**.txt'
- '**.yml'
- '**.yaml'
permissions:
contents: read
jobs:
test-pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/pip
~/.local/lib/python3.10/site-packages
~/.paddleocr/
key: ${{ runner.os }}-dependencies-${{ hashFiles('**/requirements.txt', 'pyproject.toml') }}
restore-keys: |
${{ runner.os }}-dependencies-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install paddlepaddle==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cpu/
pip install -e .
- name: Test with pytest
run: |
pytest --verbose tests/