Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
a300abd
Update README.md
raoyutian Oct 29, 2024
5275365
Update cosine_similarity.cc
Zheng-Bicheng Nov 7, 2024
eca2ae8
fix: build error without ENABLE_PADDLE2ONNX
MistEO Nov 19, 2024
f5ccf62
perf: ReadBinaryFromFile supports Chinese path
MistEO Nov 19, 2024
1bbba6f
fix: build error on old C++ std
MistEO Nov 19, 2024
5662fa3
fix: build error for CI
MistEO Nov 19, 2024
e321ae5
fix: windows build error
MistEO Nov 19, 2024
2507a17
feat: select adapter id for DirectML
MistEO Nov 20, 2024
227cc37
fix: config including
MistEO Nov 21, 2024
11214a6
fix: typo of log
MistEO Nov 21, 2024
ec3d4c7
fix: valid_directml_backends
MistEO Nov 21, 2024
577b7a7
support reduce_dialogue_repetition
Jan 6, 2025
cbd7720
make return_all_tokens work
Jan 6, 2025
093614e
support stop_seqs
Jan 7, 2025
8266ed7
fix bug
Jan 7, 2025
c7e1d58
fix bug
Jan 7, 2025
c249b98
fix bug
Jan 8, 2025
97e541e
Merge pull request #2584 from ming1753/internet
Jiang-Jia-Jun Jan 8, 2025
47aacb5
add speculate_decoding framework
Wanglongzhi2001 Oct 29, 2024
e52155f
v1.0 align accuracy
Wanglongzhi2001 Dec 17, 2024
d5b6499
remove debug log
Wanglongzhi2001 Dec 17, 2024
389015b
remove debug log
Wanglongzhi2001 Dec 17, 2024
08877a9
refactor code
Wanglongzhi2001 Dec 17, 2024
e3bc5aa
fix typo
Wanglongzhi2001 Dec 17, 2024
ce3c09d
import proposer from nlp
Wanglongzhi2001 Dec 22, 2024
934e8d8
update
Wanglongzhi2001 Dec 23, 2024
ae57a2b
fix typo
Wanglongzhi2001 Dec 23, 2024
5c42585
update
Wanglongzhi2001 Dec 23, 2024
ed5f65a
fix typo
Wanglongzhi2001 Dec 23, 2024
99d0921
update
Wanglongzhi2001 Jan 9, 2025
fe35dc5
update version of info_dict
Wanglongzhi2001 Jan 10, 2025
f968fdf
Merge pull request #2564 from MaaXYZ/fix/config_including
Jiang-Jia-Jun Jan 10, 2025
17d204b
Merge pull request #2561 from MaaXYZ/feat/directml
Jiang-Jia-Jun Jan 10, 2025
618826b
Merge pull request #2560 from MaaXYZ/perf/read_file
Jiang-Jia-Jun Jan 10, 2025
d4bbdbe
Merge pull request #2559 from MaaXYZ/fix/build_error
Jiang-Jia-Jun Jan 10, 2025
947f230
Merge pull request #2542 from raoyutian/develop
Jiang-Jia-Jun Jan 10, 2025
19e752c
Merge pull request #2541 from Wanglongzhi2001/speculate_decoding
Jiang-Jia-Jun Jan 10, 2025
907aff7
update doc
jerrywgz Jan 15, 2025
2dd9870
Merge pull request #2586 from jerrywgz/update_doc
Jiang-Jia-Jun Jan 16, 2025
47cddc5
update docs
kevincheng2 Feb 5, 2025
c521c6a
Merge pull request #2590 from kevincheng2/develop
juncaipeng Feb 8, 2025
9faf1b5
Merge branch 'PaddlePaddle:develop' into develop
Zheng-Bicheng Feb 12, 2025
eb141a0
Merge pull request #2548 from Zheng-Bicheng/develop
Jiang-Jia-Jun Feb 13, 2025
4f4f2e1
fix Windows text encoding issue causing infinite loop
Feb 14, 2025
980c0a1
Merge pull request #2592 from jules-ai/develop
Jiang-Jia-Jun Feb 24, 2025
4d8b140
Merge branch 'upstream/release/1.1.0' into dev
SherkeyXD Sep 7, 2026
f7e23de
ci: 重构构建脚本,实现多平台构建
SherkeyXD Sep 7, 2026
72664dc
fix(infer): avoid IndexError when stop sequences are empty in dy_inpu…
SherkeyXD Sep 7, 2026
f376966
fix(infer): organize stop sequence inputs by batch index to isolate c…
SherkeyXD Sep 7, 2026
4ce37e7
fix(infer,processor): validate and truncate stop sequences exceeding …
SherkeyXD Sep 7, 2026
326085f
fix(infer): initialize proposer to None and disable speculation when …
SherkeyXD Sep 7, 2026
31d7b08
fix(token_processor): preserve accepted non-EOS tokens in speculation…
SherkeyXD Sep 7, 2026
7335ef1
fix(ci): use opencv@4 for macOS arm64 build to resolve OpenCV 5 API i…
SherkeyXD Sep 7, 2026
23a4a5d
feat: onnx runtime 版本更新至 1.29.0
SherkeyXD Sep 7, 2026
0d4e0d0
chore: 添加 ppocr 转 onnx 脚本
SherkeyXD Sep 8, 2026
60594ed
feat: 添加 ppocr v5 与 v6 支持
SherkeyXD Sep 8, 2026
8f49d64
rft: 优化 ci 触发条件并调整 github 相关文件
SherkeyXD Sep 8, 2026
d8d7110
rft: 重构并优化目录结构
SherkeyXD Sep 8, 2026
b0ae04f
docs: 更新 README
SherkeyXD Sep 8, 2026
f449471
feat: expose OrtSessionOptions via callback
dantmnf Aug 18, 2026
a15ab70
ci: 更新 action 版本
SherkeyXD Sep 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 0 additions & 18 deletions .github/ISSUE_TEMPLATE/english.md

This file was deleted.

10 changes: 0 additions & 10 deletions .github/ISSUE_TEMPLATE/other.md

This file was deleted.

35 changes: 0 additions & 35 deletions .github/ISSUE_TEMPLATE/报告issue.md

This file was deleted.

10 changes: 0 additions & 10 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

104 changes: 81 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,89 @@
name: Build
on: [pull_request]
name: Build and Package

on:
push:
pull_request:
branches: [ dev ]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
macOS-latest-py:
# =========================================================================
# 1. macOS ARM64 (Apple Silicon: CoreML & CPU)
# =========================================================================
build-macos-arm64:
name: macOS (arm64)
runs-on: macos-latest
steps:
- uses: actions/checkout@v7
- uses: lukka/get-cmake@latest
- name: Install System Dependencies
run: brew install opencv@4 eigen onnxruntime
- name: Build & Package
run: python3 scripts/build.py --target macos-arm64
- uses: actions/upload-artifact@v7
with:
name: fastdeploy_ppocr-macos-arm64
path: fastdeploy_ppocr-macos-arm64.tar.gz

# =========================================================================
# 2. Linux x86_64 (CPU)
# =========================================================================
build-linux-x64:
name: Linux (x64)
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v1
- uses: actions/checkout@v7
- uses: lukka/get-cmake@latest
- name: Install System Dependencies
run: sudo apt-get update && sudo apt-get install -y libopencv-dev libeigen3-dev wget tar
- name: Build & Package
run: python3 scripts/build.py --target linux-x64
- uses: actions/upload-artifact@v7
with:
name: fastdeploy_ppocr-linux-x64
path: fastdeploy_ppocr-linux-x64.tar.gz

# =========================================================================
# 3. Windows x64 (DirectML & CPU)
# =========================================================================
build-windows-x64:
name: Windows (x64)
runs-on: windows-latest
steps:
- name: Enable Git LongPaths
run: git config --system core.longpaths true
- uses: actions/checkout@v7
- uses: TheMrMilchmann/setup-msvc-dev@v4
with:
arch: x64
- uses: lukka/get-cmake@latest
- name: Build & Package
run: python scripts/build.py --target windows-x64
- uses: actions/upload-artifact@v7
with:
name: fastdeploy_ppocr-windows-x64
path: fastdeploy_ppocr-windows-x64.zip

- name: Get CMake
uses: lukka/get-cmake@latest

- name: Get Python
uses: actions/setup-python@v4
# =========================================================================
# 5. Android ARM64-v8a (Google NDK Cross Compilation)
# =========================================================================
build-android-arm64:
name: Android (arm64)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: lukka/get-cmake@latest
- name: Install System Dependencies
run: sudo apt-get update && sudo apt-get install -y libeigen3-dev wget unzip
- name: Build & Package
run: python3 scripts/build.py --target android-arm64
- uses: actions/upload-artifact@v7
with:
python-version: '3.10'

- name: Build FastDeploy
working-directory: ./python
run: |
export ENABLE_ORT_BACKEND=ON
export ENABLE_PADDLE_BACKEND=OFF
export ENABLE_OPENVINO_BACKEND=OFF
export ENABLE_VISION=ON
export ENABLE_TEXT=ON
python -m pip install wheel
python setup.py build
python setup.py bdist_wheel
ls -l
name: fastdeploy_ppocr-android-arm64
path: fastdeploy_ppocr-android-arm64.tar.gz

13 changes: 2 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,12 @@ repos:
- id: check-symlinks
- id: check-added-large-files

- repo: local
hooks:
- id: copyright_checker
name: copyright_checker
entry: python ./.copyright.hook
language: system
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|proto|py)$
exclude: (?!.*third_party)^.*$

- repo: local
hooks:
- id: clang-format-with-version-check
name: clang-format
description: Format files with ClangFormat.
entry: bash .clang_format.hook -i
entry: bash scripts/hooks/.clang_format.hook -i
language: system
files: \.(c|cc|cxx|cpp|cu|hxx|proto)$

Expand All @@ -33,6 +24,6 @@ repos:
- id: cpplint-cpp-source
name: cpplint
description: Check C++ code style using cpplint.py.
entry: bash .cpplint_pre_commit.hook
entry: bash scripts/hooks/.cpplint_pre_commit.hook
language: system
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx)$
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ find_package(onnxruntime REQUIRED)
find_package(Eigen3 REQUIRED)
message("OpenCV_LIBS: ${OpenCV_LIBS} ${OPENCV_core_FOUND} ${OPENCV_WORLD_FOUND}")

option(WITH_CUDA "Whether WITH_CUDA=ON, will enable onnxruntime-gpu/paddle-infernce-gpu/poros-gpu" OFF)
option(WITH_CUDA "Whether WITH_CUDA=ON, will enable onnxruntime-gpu/paddle-inference-gpu" OFF)
option(PRINT_INFO "Print more debug info while running" OFF)

if(WITH_CUDA)
Expand Down Expand Up @@ -132,7 +132,7 @@ install(TARGETS fastdeploy_ppocr EXPORT fastdeploy_ppocrConfig)
install(EXPORT fastdeploy_ppocrConfig DESTINATION share/fastdeploy_ppocr)
install(
DIRECTORY ${PROJECT_SOURCE_DIR}/fastdeploy
DESTINATION ${CMAKE_INSTALL_PREFIX}/include
DESTINATION include
FILES_MATCHING
PATTERN "*.h"
)
16 changes: 0 additions & 16 deletions README.md

This file was deleted.

12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# FastDeploy

This is a stripped-down version of [PaddlePaddle/FastDeploy@v1](https://github.com/PaddlePaddle/FastDeploy/tree/release/1.1.0) and [MaaAssistantArknights/FastDeploy](https://github.com/MaaAssistantArknights/FastDeploy).

## Key modifications

* ~~Removed unused components and dead code, focusing on `fastdeploy_ppocr`~~
* Use system libraries (CMake `find_package`) only
* Support in-memory model and dictionary loading
* Reorganized project layout (`bindings/`, `services/`)
* Add support for PP-OCR v5 and v6
* Add multi-platform build script (`scripts/build.py`)
1 change: 0 additions & 1 deletion VERSION_NUMBER

This file was deleted.

48 changes: 48 additions & 0 deletions benchmark/python/benchmark_ppocr.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,54 @@ def cpu_stat_func(self, q, pid, interval=0.0):
runtime_option=rec_option)
model = fd.vision.ocr.PPOCRv4(
det_model=det_model, cls_model=cls_model, rec_model=rec_model)
elif "OCRv5" in args.model_dir:
det_option = option
if args.backend in ["trt", "paddle_trt"]:
det_option.trt_option.set_shape(
"x", [1, 3, 64, 64], [1, 3, 640, 640], [1, 3, 960, 960])
det_model = fd.vision.ocr.DBDetector(
det_model_file, det_params_file, runtime_option=det_option)
cls_option = option
if args.backend in ["trt", "paddle_trt"]:
cls_option.trt_option.set_shape(
"x", [1, 3, 48, 10], [10, 3, 48, 320], [64, 3, 48, 1024])
cls_model = fd.vision.ocr.Classifier(
cls_model_file, cls_params_file, runtime_option=cls_option)
rec_option = option
if args.backend in ["trt", "paddle_trt"]:
rec_option.trt_option.set_shape(
"x", [1, 3, 48, 10], [10, 3, 48, 320], [64, 3, 48, 2304])
rec_model = fd.vision.ocr.Recognizer(
rec_model_file,
rec_params_file,
rec_label_file,
runtime_option=rec_option)
model = fd.vision.ocr.PPOCRv5(
det_model=det_model, cls_model=cls_model, rec_model=rec_model)
elif "OCRv6" in args.model_dir:
det_option = option
if args.backend in ["trt", "paddle_trt"]:
det_option.trt_option.set_shape(
"x", [1, 3, 64, 64], [1, 3, 640, 640], [1, 3, 960, 960])
det_model = fd.vision.ocr.DBDetector(
det_model_file, det_params_file, runtime_option=det_option)
cls_option = option
if args.backend in ["trt", "paddle_trt"]:
cls_option.trt_option.set_shape(
"x", [1, 3, 48, 10], [10, 3, 48, 320], [64, 3, 48, 1024])
cls_model = fd.vision.ocr.Classifier(
cls_model_file, cls_params_file, runtime_option=cls_option)
rec_option = option
if args.backend in ["trt", "paddle_trt"]:
rec_option.trt_option.set_shape(
"x", [1, 3, 48, 10], [10, 3, 48, 320], [64, 3, 48, 2304])
rec_model = fd.vision.ocr.Recognizer(
rec_model_file,
rec_params_file,
rec_label_file,
runtime_option=rec_option)
model = fd.vision.ocr.PPOCRv6(
det_model=det_model, cls_model=cls_model, rec_model=rec_model)
else:
raise Exception("model {} not support now in ppocr series".format(
args.model_dir))
Expand Down
8 changes: 4 additions & 4 deletions c_api/CMakeLists.txt → bindings/c_api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ if(NOT WITH_CAPI)
return()
endif()

configure_file(${PROJECT_SOURCE_DIR}/${CSRCS_DIR_NAME}/c_api/fastdeploy_capi/core/config.h.in ${PROJECT_SOURCE_DIR}/${CSRCS_DIR_NAME}/c_api/fastdeploy_capi/core/config.h)
file(GLOB_RECURSE DEPLOY_CAPI_SRCS ${PROJECT_SOURCE_DIR}/${CSRCS_DIR_NAME}/c_api/fastdeploy_capi/*.cc)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fastdeploy_capi/core/config.h.in ${CMAKE_CURRENT_SOURCE_DIR}/fastdeploy_capi/core/config.h)
file(GLOB_RECURSE DEPLOY_CAPI_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/fastdeploy_capi/*.cc)
if(NOT ENABLE_VISION)
file(GLOB_RECURSE DEPLOY_VISION_CAPI_SRCS ${PROJECT_SOURCE_DIR}/${CSRCS_DIR_NAME}/c_api/fastdeploy_capi/vision/*.cc)
file(GLOB_RECURSE DEPLOY_VISION_CAPI_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/fastdeploy_capi/vision/*.cc)
list(REMOVE_ITEM DEPLOY_CAPI_SRCS ${DEPLOY_VISION_CAPI_SRCS})
endif()
list(APPEND ALL_DEPLOY_SRCS ${DEPLOY_CAPI_SRCS})
include_directories(${PROJECT_SOURCE_DIR}/${CSRCS_DIR_NAME}/c_api)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@ DEFINE_PIPELINE_MODEL_WRAPPER_STRUCT(PPOCRv3, ppocrv3_model);
// PPOCRv4
DEFINE_PIPELINE_MODEL_WRAPPER_STRUCT(PPOCRv4, ppocrv4_model);

// PPOCRv5
DEFINE_PIPELINE_MODEL_WRAPPER_STRUCT(PPOCRv5, ppocrv5_model);

// PPOCRv6
DEFINE_PIPELINE_MODEL_WRAPPER_STRUCT(PPOCRv6, ppocrv6_model);

// PPStructureV2Table
DEFINE_PIPELINE_MODEL_WRAPPER_STRUCT(PPStructureV2Table, ppstructurev2table_model);

Expand Down Expand Up @@ -407,6 +413,12 @@ DECLARE_PIPELINE_MODEL_FUNC_FOR_GET_PTR_FROM_WRAPPER(PPOCRv3, fd_ppocrv3_wrapper
// PPOCRv4
DECLARE_PIPELINE_MODEL_FUNC_FOR_GET_PTR_FROM_WRAPPER(PPOCRv4, fd_ppocrv4_wrapper);

// PPOCRv5
DECLARE_PIPELINE_MODEL_FUNC_FOR_GET_PTR_FROM_WRAPPER(PPOCRv5, fd_ppocrv5_wrapper);

// PPOCRv6
DECLARE_PIPELINE_MODEL_FUNC_FOR_GET_PTR_FROM_WRAPPER(PPOCRv6, fd_ppocrv6_wrapper);

// PPStructureV2Table
DECLARE_PIPELINE_MODEL_FUNC_FOR_GET_PTR_FROM_WRAPPER(PPStructureV2Table, fd_ppstructurev2_table_wrapper);

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading