This is an Image Processing library using TPU on CVI1835.
Note:
1. bmtap2 docker environment is recomended.
2. Run ./clang-format.sh
before pushing the code.
- Middleware headers
- MLIR SDK
- Tracer lib
Tracer lib can be get from GitLab at http://10.34.33.3:8480/sys_app/tracer
. Put the Tracer lib under the 3rdparty
folder.
$ mkdir build
$ cd build
$ CC=clang CXX=clang++ \
cmake -G Ninja .. -DMLIR_SDK_ROOT=${PWD}/../../cvitek_mlir \
-DMIDDLEWARE_SDK_ROOT=${PWD}/../../middleware \
-DCMAKE_BUILD_TYPE=Release
$ ninja -j8
SOC mode
- 64-bit
$ mkdir build_soc
$ cd build
$ cmake -G Ninja .. -DENABLE_SYSTRACE=ON \
-DCVI_TARGET=soc \
-DTOOLCHAIN_ROOT_DIR=${PWD}/../../gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu \
-DCMAKE_TOOLCHAIN_FILE=${PWD}/../toolchain/toolchain-aarch64-linux.cmake \
-DMLIR_SDK_ROOT=${PWD}/../../mlir/sdk/cvitek_tpu_sdk \
-DMIDDLEWARE_SDK_ROOT=${PWD}/../prebuilt/middleware \
-DCMAKE_BUILD_TYPE=Release
$ ninja -j8
- 32-bit
$ mkdir build_soc
$ cd build
$ cmake -G Ninja .. -DCVI_TARGET=soc \
-DTOOLCHAIN_ROOT_DIR=${PWD}/../../gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf \
-DCMAKE_TOOLCHAIN_FILE=${PWD}/../toolchain/toolchain-gnueabihf-linux.cmake \
-DMLIR_SDK_ROOT=${PWD}/../../cvitek_tpu_sdk \
-DMIDDLEWARE_SDK_ROOT=${PWD}/../../middleware \
-DCMAKE_BUILD_TYPE=Release
$ ninja -j8
Note: To make sure everytime you configure cmake correctly, you can set the compiler flags to empty with command.
cmake -G Ninja .. -DCMAKE_C_COMPILER="" \
-DCMAKE_CXX_COMPILER="" \
......
You may install the library with the following command.
$ninja install
- Add
- And
- Block
- Copy
- Filter
- HOG
- Morphology- Binary dilate/ erode
- Normalize gradient
- Or
- SAD
- Sigmoid
- Sobel X/ Y Gradient
- Sub
- a - b
- abs(a - b)
- Threshold
- Binary threshold w/o high low value
- Slope
- Xor
- U16 related image conversion.
- U16, S16 to U8, S8 threshold.
- Currently TPU API does not support TL(BF16) to TG(FP32).
- Some required API is missing,
- div
Chip | Flags |
---|---|
cv1835 | WORKAROUND_SCALAR_4096_ALIGN_BUG |