Skip to content

Commit

Permalink
update ppl.cv
Browse files Browse the repository at this point in the history
  • Loading branch information
lzhangzz committed Jul 11, 2022
1 parent 431a3bc commit 2dcf60a
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 40 deletions.
3 changes: 1 addition & 2 deletions .circleci/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ ARG PYTHON_VERSION=3.8
ARG TORCH_VERSION=1.10.0
ARG TORCHVISION_VERSION=0.11.0
ARG MMCV_VERSION=1.5.0
ARG PPLCV_VERSION=0.6.2
ENV FORCE_CUDA="1"

ENV DEBIAN_FRONTEND=noninteractive
Expand Down Expand Up @@ -34,7 +33,7 @@ WORKDIR /workspace
### build ppl.cv
RUN git clone https://github.com/openppl-public/ppl.cv.git &&\
cd ppl.cv &&\
git checkout tags/v${PPLCV_VERSION} -b v${PPLCV_VERSION} &&\
git checkout 58ed74ec61f84f3dc7327f8b983b5e2bc4000fed &&\
./build.sh cuda

# RUN ln -sf /opt/conda /home/circleci/project/conda
Expand Down
10 changes: 1 addition & 9 deletions csrc/mmdeploy/preprocess/cuda/pad_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,10 @@ namespace cuda {
class PadImpl : public ::mmdeploy::PadImpl {
public:
explicit PadImpl(const Value& args) : ::mmdeploy::PadImpl(args) {
#if PPLCV_VERSION_MAJOR >= 0 && PPLCV_VERSION_MINOR >= 6 && PPLCV_VERSION_PATCH >= 2
map<string, ppl::cv::BorderType> border_map{{"constant", ppl::cv::BORDER_CONSTANT},
{"edge", ppl::cv::BORDER_REPLICATE},
{"reflect", ppl::cv::BORDER_REFLECT_101},
{ "symmetric",
ppl::cv::BORDER_REFLECT }};
#else
map<string, ppl::cv::BorderType> border_map{{"constant", ppl::cv::BORDER_TYPE_CONSTANT},
{"edge", ppl::cv::BORDER_TYPE_REPLICATE},
{"reflect", ppl::cv::BORDER_TYPE_REFLECT_101},
{"symmetric", ppl::cv::BORDER_TYPE_REFLECT}};
#endif
{"symmetric", ppl::cv::BORDER_REFLECT}};
if (border_map.find(arg_.padding_mode) == border_map.end()) {
MMDEPLOY_ERROR("unsupported padding_mode '{}'", arg_.padding_mode);
throw_exception(eNotSupported);
Expand Down
11 changes: 0 additions & 11 deletions csrc/mmdeploy/preprocess/cuda/resize_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class ResizeImpl final : public ::mmdeploy::ResizeImpl {
private:
template <class T, int C, class... Args>
ppl::common::RetCode DispatchImpl(Args&&... args) {
#if PPLCV_VERSION_MAJOR >= 0 && PPLCV_VERSION_MINOR >= 6 && PPLCV_VERSION_PATCH >= 2
if (arg_.interpolation == "bilinear") {
return ppl::cv::cuda::Resize<T, C>(std::forward<Args>(args)...,
ppl::cv::INTERPOLATION_LINEAR);
Expand All @@ -54,16 +53,6 @@ class ResizeImpl final : public ::mmdeploy::ResizeImpl {
return ppl::cv::cuda::Resize<T, C>(std::forward<Args>(args)...,
ppl::cv::INTERPOLATION_NEAREST_POINT);
}
#else
if (arg_.interpolation == "bilinear") {
return ppl::cv::cuda::Resize<T, C>(std::forward<Args>(args)...,
ppl::cv::INTERPOLATION_TYPE_LINEAR);
}
if (arg_.interpolation == "nearest") {
return ppl::cv::cuda::Resize<T, C>(std::forward<Args>(args)...,
ppl::cv::INTERPOLATION_TYPE_NEAREST_POINT);
}
#endif
return ppl::common::RC_UNSUPPORTED;
}

Expand Down
3 changes: 1 addition & 2 deletions docker/GPU/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ ARG TORCH_VERSION=1.8.0
ARG TORCHVISION_VERSION=0.9.0
ARG ONNXRUNTIME_VERSION=1.8.1
ARG MMCV_VERSION=1.4.0
ARG PPLCV_VERSION=0.6.2
ENV FORCE_CUDA="1"

ENV DEBIAN_FRONTEND=noninteractive
Expand Down Expand Up @@ -68,7 +67,7 @@ RUN git clone https://github.com/open-mmlab/mmdeploy &&\
### build sdk
RUN git clone https://github.com/openppl-public/ppl.cv.git &&\
cd ppl.cv &&\
git checkout tags/v${PPLCV_VERSION} -b v${PPLCV_VERSION} &&\
git checkout 58ed74ec61f84f3dc7327f8b983b5e2bc4000fed &&\
./build.sh cuda

ENV BACKUP_LD_LIBRARY_PATH=$LD_LIBRARY_PATH
Expand Down
5 changes: 2 additions & 3 deletions docs/en/01-how-to-build/linux-x86_64.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,12 @@ sudo apt-get install libopencv-dev
<tr>
<td>pplcv </td>
<td>A high-performance image processing library of openPPL.<br>
<b>It is optional which only be needed if <code>cuda</code> platform is required.
Now, MMDeploy supports v0.6.2 and has to use <code>git clone</code> to download it.</b><br>
<b>It is optional which only be needed if <code>cuda</code> platform is required.</b><br>
<pre><code>
git clone https://github.com/openppl-public/ppl.cv.git
cd ppl.cv
export PPLCV_DIR=$(pwd)
git checkout tags/v0.6.2 -b v0.6.2
git checkout 58ed74ec61f84f3dc7327f8b983b5e2bc4000fed
./build.sh cuda
</code></pre>
</td>
Expand Down
7 changes: 3 additions & 4 deletions docs/en/01-how-to-build/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,15 @@ You can skip this chapter if you are only interested in the model converter.
<tr>
<td>pplcv </td>
<td>A high-performance image processing library of openPPL.<br>
<b>It is optional which only be needed if <code>cuda</code> platform is required.
Now, MMDeploy supports v0.6.2 and has to use <code>git clone</code> to download it.</b><br>
<b>It is optional which only be needed if <code>cuda</code> platform is required.</b><br>
<pre><code>
git clone https://github.com/openppl-public/ppl.cv.git
cd ppl.cv
git checkout tags/v0.6.2 -b v0.6.2
git checkout 58ed74ec61f84f3dc7327f8b983b5e2bc4000fed
$env:PPLCV_DIR = "$pwd"
mkdir pplcv-build
cd pplcv-build
cmake .. -G "Visual Studio 16 2019" -T v142 -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -DHPCC_USE_CUDA=ON -DHPCC_MSVC_MD=ON
cmake .. -G "Visual Studio 16 2019" -T v142 -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -DHPCC_USE_CUDA=ON -DPPLCV_USE_MSVC_STATIC_RUNTIME=OFF
cmake --build . --config Release -- /m
cmake --install . --config Release
cd ../..
Expand Down
4 changes: 2 additions & 2 deletions docs/zh_cn/01-how-to-build/linux-x86_64.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ sudo apt-get install libopencv-dev
</tr>
<tr>
<td>pplcv </td>
<td>pplcv 是 openPPL 开发的高性能图像处理库。 <b>此依赖项为可选项,只有在 cuda 平台下,才需安装。而且,目前必须使用 v0.6.2,且需要使用 git clone 的方式下载源码并编译安装</b><br>
<td>pplcv 是 openPPL 开发的高性能图像处理库。 <b>此依赖项为可选项,只有在 cuda 平台下,才需安装。</b><br>
<pre><code>
git clone https://github.com/openppl-public/ppl.cv.git
cd ppl.cv
export PPLCV_DIR=$(pwd)
git checkout tags/v0.6.2 -b v0.6.2
git checkout 58ed74ec61f84f3dc7327f8b983b5e2bc4000fed
./build.sh cuda
</code></pre>
</td>
Expand Down
6 changes: 3 additions & 3 deletions docs/zh_cn/01-how-to-build/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ pip install mmcv-full==1.4.0 -f https://download.openmmlab.com/mmcv/dist/$env:cu
</tr>
<tr>
<td>pplcv </td>
<td>pplcv 是 openPPL 开发的高性能图像处理库。 <b>此依赖项为可选项,只有在 cuda 平台下,才需安装。而且,目前必须使用 v0.6.2,且需要使用 git clone 的方式下载源码并编译安装</b><br>
<td>pplcv 是 openPPL 开发的高性能图像处理库。 <b>此依赖项为可选项,只有在 cuda 平台下,才需安装。</b><br>
<pre><code>
git clone https://github.com/openppl-public/ppl.cv.git
cd ppl.cv
git checkout tags/v0.6.2 -b v0.6.2
git checkout 58ed74ec61f84f3dc7327f8b983b5e2bc4000fed
$env:PPLCV_DIR = "$pwd"
mkdir pplcv-build
cd pplcv-build
cmake .. -G "Visual Studio 16 2019" -T v142 -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -DHPCC_USE_CUDA=ON -DHPCC_MSVC_MD=ON
cmake .. -G "Visual Studio 16 2019" -T v142 -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install -DPPLCV_USE_CUDA=ON -DPPLCV_USE_MSVC_STATIC_RUNTIME=OFF
cmake --build . --config Release -- /m
cmake --install . --config Release
cd ../..
Expand Down
7 changes: 3 additions & 4 deletions tools/scripts/build_linux_nvidia.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ MMDEPLOY_DIR=${WORKING_DIR}

#####
# Versions
PPLCV_VER="0.6.2"
CMAKE_VER="3.23.0"

#####
Expand Down Expand Up @@ -327,7 +326,7 @@ pplcv() {
fi
cd ${PPLCV_DIR}
git pull
git checkout tags/v${PPLCV_VER}
git checkout 58ed74ec61f84f3dc7327f8b983b5e2bc4000fed

# remove all build files
if [[ $WITH_CLEAN -eq 1 ]]
Expand All @@ -337,14 +336,14 @@ pplcv() {

# build
mkdir build -p && cd build
cmake -DHPCC_USE_CUDA=ON -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} .. && make -j${processor_num} && sudo make install
cmake -DPPLCV_USE_CUDA=ON -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} .. && make -j${processor_num} && sudo make install
sudo ldconfig

# generate prebuild and pack into .tar.gz
if [[ $WITH_PREBUILD -eq 1 ]]
then
sudo make DESTDIR=./prebuild install
tar -zcvf ${WORKING_DIR}/pplcv_${PPLCV_VER}_cuda-${ARCH}-build.tar.gz -C ./prebuild/ .
tar -zcvf ${WORKING_DIR}/pplcv_58ed74ec61f84f3dc7327f8b983b5e2bc4000fed_cuda-${ARCH}-build.tar.gz -C ./prebuild/ .
fi
}

Expand Down

0 comments on commit 2dcf60a

Please sign in to comment.