简体中文 | English
This project is mainly based on the development of the OpenVINOTMC # API project, using the C # programming language NET framework, use OpenVINOTM deployment tool to deploy PaddleOCR series models under Baidu PaddlePaddle, and realize image text recognition, layout analysis, table recognition and other functions. The project provides simple cases and API interfaces for secondary development, which can be developed and used according to your own needs.
In this project, we mainly use our self-developed **OpenVINOTM C # API ** project and **OpenCvSharp4 **project. The **NuGet Package ** package and installation method used are as follows:
-
OpenVINO.CSharp.API >= 2023.2.0.2
-
OpenVINO.runtime.win >= 2023.2.0.1
-
OpenCvSharp4.Windows >= 4.8.0.20230708
-
OpenCvSharp4.Extensions >= 4.8.0.20230708
NuGet Package can be installed through Visual Studio or through the **dotnet ** command. The installation method is as follows:
dotnet add package OpenVINO.CSharp.API
dotnet add package OpenVINO.runtime.win
dotnet add package OpenCvSharp4.Windows
dotnet add package OpenCvSharp4.Extensions
git clone https://github.com/guojin-yan/PaddleOCR-OpenVINO-CSharp.git
cd PaddleOCR-OpenVINO-CSharp
The models used in the project are all from PaddleOCR The model directory can be referenced
Attention:After testing, OpenVINO currently supports all models in the PP-OCR Model List and PP Structure Model List, as well as models in PaddlePaddle format. Users can use them directly after downloading, but the table recognition model ppstructure_ Mobile_ V2.0_ SLANet needs to be converted before it can be used, and the input shape of the fixed mold line needs to be [1, 3, 488, 488]. The conversion method keyi refers to the article: Paddle2ONNX
For the convenience of quick use, here is a quick download method for the model:
cd model
./ocr_model_download.sh
./stru_model_download.sh
The directory structure of the downloaded model file is:
model
├──── paddle
├──── ch_ppocr_mobile_v2.0_cls_infer
├──── ch_PP-OCRv4_det_infer
├──── ch_PP-OCRv4_rec_infer
├──── ch_ppstructure_mobile_v2.0_SLANet_infer
├──── en_ppstructure_mobile_v2.0_SLANet_infer
├──── picodet_lcnet_x1_0_fgd_layout_cdla_infer
You can run the project directly through **Visual Studio ** or through the **dotnet run ** command. The **dotnet run ** command is as follows:
cd PaddleOCR-OpenVINO-CSharp/sample
dotnet run ./../../
The output after running the program is shown in the following figure:
If you are planning to deploy the PaddleOCR model using OpenVINO, please refer to this case. If you have any questions during use, you can contact me through the following methods.