From b7d97547be82c3f656e0b9de47ef19744e3de542 Mon Sep 17 00:00:00 2001 From: UnknownObject Date: Sat, 17 May 2025 20:13:21 +0800 Subject: [PATCH] change model name & write readme --- ...ctionModel-EN.onnx => DetectionModel.onnx} | Bin EasyOCR-CPP/EasyOCR-CPP.cpp | 9 ++-- README.md | 41 +++++++++++++++++- 3 files changed, 44 insertions(+), 6 deletions(-) rename EasyOCR-CPP/{DetectionModel-EN.onnx => DetectionModel.onnx} (100%) diff --git a/EasyOCR-CPP/DetectionModel-EN.onnx b/EasyOCR-CPP/DetectionModel.onnx similarity index 100% rename from EasyOCR-CPP/DetectionModel-EN.onnx rename to EasyOCR-CPP/DetectionModel.onnx diff --git a/EasyOCR-CPP/EasyOCR-CPP.cpp b/EasyOCR-CPP/EasyOCR-CPP.cpp index 88e3e48..406b655 100644 --- a/EasyOCR-CPP/EasyOCR-CPP.cpp +++ b/EasyOCR-CPP/EasyOCR-CPP.cpp @@ -8,11 +8,10 @@ int main() { - const std::wstring detModelPath = L"F:\\SVProjects\\EasyOCR-CPP\\EasyOCR-CPP\\DetectionModel-EN.onnx"; - const std::wstring recModelPath = L"F:\\SVProjects\\EasyOCR-CPP\\EasyOCR-CPP\\RecognitionModel-EN.onnx"; - const std::wstring recModelWithChnPath = L"F:\\SVProjects\\EasyOCR-CPP\\EasyOCR-CPP\\RecognitionModel_EN+CH_SIM.onnx"; - const std::string imagePath = "G:\\Users\\15819\\Desktop\\vin-2-o.jpg"; - //const std::string imagePath = "G:\\Users\\15819\\Pictures\\SSP_ScreenShot\\Screen[0] AT 20250506151949601 - 927136.png"; + const std::wstring detModelPath = L".\\DetectionModel.onnx"; + const std::wstring recModelPath = L".\\RecognitionModel-EN.onnx"; + const std::wstring recModelWithChnPath = L".\\RecognitionModel_EN+CH_SIM.onnx"; + const std::string imagePath = ""; //Init Config uns::G_OCRConfig.SetGPUUsage(uns::OCRConfig::GPUUsage::PreferGPU); diff --git a/README.md b/README.md index 41a562c..24fe515 100644 --- a/README.md +++ b/README.md @@ -1 +1,40 @@ -# EasyOCR-CPP \ No newline at end of file +# EasyOCR-CPP + +A C++ implementation of EasyOCR using ONNXRuntime. + +## Library Needed + +- OpenCV 4.10 +- ONNXRuntime 1.19.2 +- NVIDIA CUDA 11.7 (Optional) + +## C++ Version + +C++17 or above. + +## Build + +Using Visual Studio 2022 or later, open the `EasyOCR-CPP.sln` file and build the `EasyOCR-CPP` project. + +## Model Info + +### Detection Model + +Detection model can handle all kinds of language that EasyOCR can recognize. + +### Recognition Model + +Recognition model is different for each language. In this project, the `English` and `English+Chinese` model are provided. + +## Usage + +See `EasyOCR-CPP/EasyOCR-CPP.cpp` for an example usage. + +## Todo + +Provide A modified version of EasyOCR that can export any recognition model to ONNX format easily. + +## Other Informations + +EasyOCR Library: https://github.com/JaidedAI/EasyOCR +ONNX Model Export Guide: https://github.com/JaidedAI/EasyOCR/issues/746 \ No newline at end of file