Coder Social home page Coder Social logo

Comments (2)

fengyuentau avatar fengyuentau commented on July 26, 2024 1
  1. Compile OpenCV with CUDA. Following is the CMake command I used, you will have to fit it in your case:
    cmake -D CMAKE_BUILD_TYPE=RELEASE \
     -D CMAKE_INSTALL_PREFIX=./install \
     -D BUILD_opencv_python2=OFF \
     -D BUILD_opencv_python3=ON \
     -D PYTHON3_LIBRARY=/usr/lib/aarch64-linux-gnu/libpython3.6m.so \
     -D PYTHON3_INCLUDE_DIR=/usr/include/python3.6m \
     -D PYTHON3_EXECUTABLE=/usr/bin/python3.6 \
     -D WITH_CUDA=ON \
     -D WITH_CUDNN=ON \
     -D OPENCV_DNN_CUDA=ON \
     -D CUDA_FAST_MATH=ON \
     -D ENABLE_FAST_MATH=1 \
     -D CUDA_ARCH_BIN=5.3 \
     -D WITH_CUBLAS=1 \
     -D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-10.2 \
     -D OPENCV_EXTRA_MODULES_PATH=/home/opencv-cn/Workspace/opencv/opencv_contrib/modules  ..
    You can find your CUDA_ARCH_BIN at https://developer.nvidia.com/cuda-gpus (compute capability in the tables).
  2. Initialize YuNet & SFace with CUDA backend and GPU target in demo scripts:
    yunet = YuNet(modelPath=args.model_yunet, backendId=cv.dnn.DNN_BACKEND_CUDA, targetId=cv.dnn.DNN_TARGET_CUDA)
    sface = SFace(modelPath=args.model_sface, backendId=backendId=cv.dnn.DNN_BACKEND_CUDA, targetId=cv.dnn.DNN_TARGET_CUDA)

And you can run demo scripts and perform inference of YuNet & SFace on GPU.

from opencv_zoo.

hmh10098 avatar hmh10098 commented on July 26, 2024
  1. Compile OpenCV with CUDA. Following is the CMake command I used, you will have to fit it in your case:

    cmake -D CMAKE_BUILD_TYPE=RELEASE \
     -D CMAKE_INSTALL_PREFIX=./install \
     -D BUILD_opencv_python2=OFF \
     -D BUILD_opencv_python3=ON \
     -D PYTHON3_LIBRARY=/usr/lib/aarch64-linux-gnu/libpython3.6m.so \
     -D PYTHON3_INCLUDE_DIR=/usr/include/python3.6m \
     -D PYTHON3_EXECUTABLE=/usr/bin/python3.6 \
     -D WITH_CUDA=ON \
     -D WITH_CUDNN=ON \
     -D OPENCV_DNN_CUDA=ON \
     -D CUDA_FAST_MATH=ON \
     -D ENABLE_FAST_MATH=1 \
     -D CUDA_ARCH_BIN=5.3 \
     -D WITH_CUBLAS=1 \
     -D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-10.2 \
     -D OPENCV_EXTRA_MODULES_PATH=/home/opencv-cn/Workspace/opencv/opencv_contrib/modules  ..

    You can find your CUDA_ARCH_BIN at https://developer.nvidia.com/cuda-gpus (compute capability in the tables).

  2. Initialize YuNet & SFace with CUDA backend and GPU target in demo scripts:

    yunet = YuNet(modelPath=args.model_yunet, backendId=cv.dnn.DNN_BACKEND_CUDA, targetId=cv.dnn.DNN_TARGET_CUDA)
    sface = SFace(modelPath=args.model_sface, backendId=backendId=cv.dnn.DNN_BACKEND_CUDA, targetId=cv.dnn.DNN_TARGET_CUDA)

And you can run demo scripts and perform inference of YuNet & SFace on GPU.

thanks for your help!

from opencv_zoo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.