{"repo":"DingHsun/PaddleOCR-Inference","free":true,"listed":false,"github":"https://github.com/DingHsun/PaddleOCR-Inference","clone":"git clone https://github.com/DingHsun/PaddleOCR-Inference.git","description":"C++ inference implementation of PaddleOCR","language":"C++","stars":54,"topics":["api","cpp","ocr","computer-vision","computer-vision-ai","onnxruntime","opencv","paddleocr"],"license":"MIT","category":"machine-learning","readme_excerpt":"PaddleOCR C++ Inference PaddleOCR 的 C++ 推理實作，使用 onnxruntime 與 opencv，可運行 Windows x64 版本。 提供兩種 OCR 功能 1. 全圖識別（文字位置＋文字內容） 2. 選擇 ROI 範圍進行辨識 api server 是一個常駐 exe，同時提供： - HTTP API（ POST /ocr detect 、 POST /ocr recognize ）給其他服務呼叫 - 內建的網頁介面（見下方「前端」），瀏覽器連上去就能選圖片測試 Demo https://github.com/user-attachments/assets/414e5c84-196c-43d8-9eb9-01a9a815db8f 專案結構 前端 (frontend) frontend/ 是一個 Vue 3 + Vite 網頁，提供選圖片 + Detect/Recognize 按鈕（畫面上會把偵測到的文字框疊在圖片上）。它不是獨立的 web app——build 出來的靜態檔案由 api server 用 httplib 的 set mount point() 一起服務，同一個 port 就能連到網頁跟 API，不用另外架站、也不用處理 CORS。 開發時 （前後端分開跑，方便改介面即時看到變化）： vite.config.js 已經設定 dev proxy，把 /health 、 /ocr detect 、 /ocr recognize 轉發到 http://127.0.0.1:8080 （ api server.exe 要先另外啟動），瀏覽器連 Vite 印出來的網址（預設 http://localhost:5173 ）就能用。 要讓 api server.exe 自己就能服務網頁 （正式使用/打包時）： 會產生 frontend/dist 。之後編譯 api server （VS2022 或 CMake）時，build script 會自動把 frontend/dist 複製到輸出目錄旁邊； api server.exe 啟動後直接用瀏覽器連 http://127.0.0.1:8080/ 就會看到網頁介面，不需要另外開 npm run dev 。 ⚠️ 這步驟要在下面「建置方式」 之前 先做好，兩種建置方式都只會複製當下已經存在的 frontend/dist ，不會自動幫你 build 前端。 建置方式 Visual Studio 2022 開始之前確認 frontend/dist 已經 build 好（見上方「前端」章節），不然 Post-Build Event 複製的時候會找不到它，網頁介面就不會被打包進輸出目錄。 開啟 vs2022/PaddleOCR-cpp.slnx ，在方案總管對 api server 專案按右鍵 → 重建(Rebuild) （或直接建置）。 建置完成會自動觸發（設定在 api server.vcxproj 裡）： 1. Pre-Build Event ： taskkill 關掉還在跑的舊 api server.exe （避免 exe 檔案被佔用導致 link 失敗） 2. 編譯 3. Post-Build Event ：呼叫 copy bin.bat ，把 opencv/onnxruntime 的 DLL 跟 weights/ （如果 frontend/dist 存在也一併）複製到輸出目錄 vs2022/x64/ / ，接著自動 start 啟動剛編譯好的 api s","default_branch":null,"files":null,"tree":[],"storefront":"/r/DingHsun","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/DingHsun/PaddleOCR-Inference/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}