All Projects → NeerajGulia → Python Opencv Cuda

NeerajGulia / Python Opencv Cuda

Licence: gpl-3.0
custom opencv_contrib module which exposes opencv cuda optical flow methods with python bindings

Labels

Projects that are alternatives of or similar to Python Opencv Cuda

Cudadrv.jl
A Julia wrapper for the CUDA driver API.
Stars: ✭ 64 (-25.58%)
Mutual labels:  cuda
Parenchyma
An extensible HPC framework for CUDA, OpenCL and native CPU.
Stars: ✭ 71 (-17.44%)
Mutual labels:  cuda
Nnabla Ext Cuda
A CUDA Extension of Neural Network Libraries
Stars: ✭ 79 (-8.14%)
Mutual labels:  cuda
Autodock Gpu
AutoDock for GPUs and other accelerators
Stars: ✭ 65 (-24.42%)
Mutual labels:  cuda
Deepjointfilter
The source code of ECCV16 'Deep Joint Image Filtering'.
Stars: ✭ 68 (-20.93%)
Mutual labels:  cuda
Cudart.jl
Julia wrapper for CUDA runtime API
Stars: ✭ 75 (-12.79%)
Mutual labels:  cuda
Mpn Cov
@ICCV2017: For exploiting second-order statistics, we propose Matrix Power Normalized Covariance pooling (MPN-COV) ConvNets, different from and outperforming those using global average pooling.
Stars: ✭ 63 (-26.74%)
Mutual labels:  cuda
Mpr
Reference implementation for "Massively Parallel Rendering of Complex Closed-Form Implicit Surfaces" (SIGGRAPH 2020)
Stars: ✭ 84 (-2.33%)
Mutual labels:  cuda
Project Currennt Public
CURRENNNT codes and scripts
Stars: ✭ 69 (-19.77%)
Mutual labels:  cuda
2016 super resolution
ICCV2015 Image Super-Resolution Using Deep Convolutional Networks
Stars: ✭ 78 (-9.3%)
Mutual labels:  cuda
Build Deep Learning Env With Tensorflow Python Opencv
Tutorial on how to build your own research envirorment for Deep Learning with OpenCV, Python, Tensorfow
Stars: ✭ 66 (-23.26%)
Mutual labels:  cuda
Torch sampling
Efficient reservoir sampling implementation for PyTorch
Stars: ✭ 68 (-20.93%)
Mutual labels:  cuda
Hiop
HPC solver for nonlinear optimization problems
Stars: ✭ 75 (-12.79%)
Mutual labels:  cuda
Arboretum
Gradient Boosting powered by GPU(NVIDIA CUDA)
Stars: ✭ 64 (-25.58%)
Mutual labels:  cuda
Modulated Deform Conv
deformable convolution 2D 3D DeformableConvolution DeformConv Modulated Pytorch CUDA
Stars: ✭ 81 (-5.81%)
Mutual labels:  cuda
Cudadtw
GPU-Suite
Stars: ✭ 63 (-26.74%)
Mutual labels:  cuda
Titan
A high-performance CUDA-based physics simulation sandbox for soft robotics and reinforcement learning.
Stars: ✭ 73 (-15.12%)
Mutual labels:  cuda
Knn cuda
pytorch knn [cuda version]
Stars: ✭ 86 (+0%)
Mutual labels:  cuda
Pytorch Emdloss
PyTorch 1.0 implementation of the approximate Earth Mover's Distance
Stars: ✭ 82 (-4.65%)
Mutual labels:  cuda
Cuda Design Patterns
Some CUDA design patterns and a bit of template magic for CUDA
Stars: ✭ 78 (-9.3%)
Mutual labels:  cuda

python-opencv-cuda

Solution

  1. Create custom opencv_contrib module
  2. Write C++ code to wrap the OpenCV CUDA method
  3. Using OpenCV python bindings, expose your custom method
  4. Build opencv with opencv_contrib
  5. Run python code to test

Steps to create the build

Unzip the source:

  1. opencv source code: https://github.com/opencv/opencv/archive/3.4.2.zip
  2. opencv_contrib source code: https://github.com/opencv/opencv_contrib/archive/3.4.2.zip

Create custom module

  1. Copy the folder named "pythoncuda" (inside c++ folder) to: opencv_contrib/modules

Build opencv using following cmake command

  1. create build directory inside the opencv folder, cd to the build directory
  2. cmake (I used anaconda3 with environment named as: tensorflow_p36 (with python 3.6))
cmake \
-DCMAKE_BUILD_TYPE=RELEASE \
-DWITH_CUDA=ON \
-DCMAKE_INSTALL_PREFIX="/home/$USER/anaconda3/envs/tensorflow_p36" \
-DOPENCV_EXTRA_MODULES_PATH="../../opencv_contrib-3.4.2/modules" \
-DINSTALL_PYTHON_EXAMPLES=OFF \
-DINSTALL_C_EXAMPLES=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_DOCS=OFF \
-DBUILD_TESTS=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_PERF_TESTS=OFF \
-DBUILD_opencv_dnn=OFF \
-DTINYDNN_USE_NNPACK=OFF \
-DTINYDNN_USE_TBB=ON \
-DTINYDNN_USE_OMP=ON \
-DENABLE_FAST_MATH=ON \
-DWITH_OPENMP=ON \
-DWITH_TBB=ON \
-DWITH_JPEG=OFF \
-DWITH_IPP=OFF \
-DMKL_WITH_TBB=ON \
-DMKL_WITH_OPENMP=ON \
-DBUILD_opencv_python2=OFF \
-DPYTHON_EXECUTABLE="/home/$USER/anaconda3/envs/tensorflow_p36/bin/python" \
-DPYTHON_LIBRARY="/home/$USER/anaconda3/envs/tensorflow_p36/lib/python3.6" \
-DPYTHON3_LIBRARY="/home/$USER/anaconda3/envs/tensorflow_p36/lib/python3.6" \
-DPYTHON3_EXECUTABLE="/home/$USER/anaconda3/envs/tensorflow_p36/bin/python" \
-DPYTHON3_INCLUDE_DIR="/home/$USER/anaconda3/envs/tensorflow_p36/include/python3.6m" \
-DPYTHON3_INCLUDE_DIR2="/home/$USER/anaconda3/envs/tensorflow_p36/include" \
-DPYTHON3_NUMPY_INCLUDE_DIRS="/home/$USER/anaconda3/envs/tensorflow_p36/lib/python3.6/site-packages/numpy/core/include" \
-DPYTHON3_INCLUDE_PATH="/home/$USER/anaconda3/envs/tensorflow_p36/include/python3.6m" \
-DPYTHON3_LIBRARIES="/home/$USER/anaconda3/envs/tensorflow_p36/lib/libpython3.6m.so" \
..
  1. make
  2. sudo make install
  3. sudo ldconfig

Test the code

  1. Activate conda environment
  2. Go to folder: python/ and execute the cpu-opt_flow.py and gpu-opt_flow.py python files
python cpu-opt_flow.py
python gpu-opt_flow.py 

Output at my end:

total time in optical flow CPU processing: 74.15 sec, for: 794 frames. FPS: 10.71

total time in optical flow GPU processing: 21.98 sec, for: 794 frames. FPS: 36.12

Harware configuration:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].