3.3 KiB
Linux Compilation Tutorial
The tutorial requires some basic knowledge about Linux OS!
Though it is unclear why it needs to run in Linux... Anyway in case somebody needs it_(:з」∠)_
If you meet any other problems, please feel free to submit issue to us.
Download and Compile 3rd-party Libraries
Opencv
Please search the tutorial and install. Nothing to mention. The version 4.5.3 is confirmed to be able to use. Other versions should be OK as well, but 4.5.3 is recommended to keep it the same as the project and avoid some unnecessary problems. Installing Opencv itself is enough. opencv_contrib is not required.
PaddleOCR
- Use a hacked version: https://github.com/MistEO/PaddleOCR.
- Refer to this tutorial.
- Download extra dependencies for
PaddlePaddle. Bothavxandmklare recommended, which can improve the efficiency of calculation. However, if your CPU does not support them, you can choose compatible version of eithernoavxoropenblas(new CPUs should support them, even AMD).cudaandcudnnare GPU libraries, but I haven't tried it onPaddleOCRyet. Feel free to try it out. - If
cmakecannot findOpencv, you can try editing the finding path of Opencv. - If you are using
MKLversion, you can change the MKL Macro totrueto improve performance.
Compilation flags for your reference
cmake ../ -DPADDLE_LIB=/your_path/paddle_inference/ -DOpenCV_DIR=/your_path_to_opencv/ -DWITH_STATIC_LIB=OFF -DBUILD_SHARED=ON
# If your device does not support MKL, you can add `-DWITH_MKL=OFF` flag, and download corresponding PaddlePaddle version.
zlib
In Ubuntu:
sudo apt update && sudo apt install zlib1g-dev
sudo ldconfig
If zlib does not exist in other distribution, you can try compiling from source.
MeoAssistant
- Copy the compiled 3rd-party library to
3rdparty/libor changeCMakeLists.txtto indicate 3rd-party library path manually. - The header files in
3rdparty/include/opencvis version4.5.3. If you are using other versions, please notice there may be conflicts in header files (you can simply replace them with youropencvheader files). - Install
adb, and changeresource/config.json-Custom.adb.pathto"adb" - Copy resource files to the same folder of
libMeoAssitant.so.
cd tools
sh ./update_resource.sh <YourBuildDir>
- Call by Python interface or C interface, requiring you to write some code.
cmakecan compile a demo for testing by adding-DBUILD_TEST=ONflag
Integration Documentation
Python
Refer to the implementation of __main__ in Python demo
C
Refer to the implementation of TestCaller
C sharp
Refer to the implementation of MeoAsstGui