CV-CUDA Samples
Welcome to the CV-CUDA samples documentation! These samples demonstrate how to use CV-CUDA for GPU-accelerated computer vision and deep learning workflows.
Overview
CV-CUDA samples showcase the usage of CV-CUDA operators for GPU-accelerated computer vision workflows via simple single-operator examples or complete end-to-end deep learning pipelines.
Sample Categories
- Operators
Focused examples of individual CV-CUDA operations. Great for learning specific functionality and experimenting with parameters.
- Applications
Complete end-to-end pipelines combining preprocessing, inference, and post-processing.
- Interoperability
Examples demonstrating how CV-CUDA works with other GPU frameworks (PyTorch, CuPy, PyCUDA, etc.) through zero-copy data exchange.
Walkthrough Guide
Installation
The easiest way to get started is to use the installation script that automatically detects your CUDA version and installs the appropriate dependencies (including CV-CUDA).
Option 1: Using the Installation Script (Recommended)
cd samples
./install_samples_dependencies.sh
This script will:
Detect your CUDA version (12 or 13)
Create a virtual environment at
venv_samplesInstall all required dependencies including CV-CUDA, PyTorch, NumPy, and sample-specific packages
After installation, activate the virtual environment:
source venv_samples/bin/activate
Option 2: Build from Source
Alternatively, you can build CV-CUDA from source and install the remaining dependencies. Follow the installation guide, then use the installation script which will automatically use your local build:
cd samples
./install_samples_dependencies.sh
# Optionally install your local wheel over the PyPI version
source venv_samples/bin/activate
python3 -m pip install --force-reinstall ../build-rel/python3/repaired_wheels/cvcuda-*.whl
CV-CUDA Hello World
Once you have installed the dependencies, run the Hello World sample:
python3 samples/applications/hello_world.py
This simple example demonstrates the fundamental CV-CUDA workflow:
Reading from disk straight to GPU (no CPU-GPU copies)
Resizing and batching images for parallel processing
Applying operations (Gaussian blur) on the entire batch
Writing to disk from GPU (no CPU-GPU copies)
What You’ll See:
The sample loads an image, resizes it to 224×224, applies a Gaussian blur, and saves the result to .cache/cat_hw.jpg.
Try It with Your Own Image:
python3 samples/applications/hello_world.py -i your_image.jpg -o output.jpg
Want to Learn More?
See the complete Hello World documentation for detailed explanations of each step.
Running Samples
To test all samples at once:
./samples/run_samples.sh
This script runs every sample with default parameters. Next Steps ^^^^^^^^^^
Now that you’ve explored the basics:
Try More Samples: Experiment with different operators and applications
Modify for Your Use Case: Adapt samples for your specific needs
Read the API Documentation: Explore the full Python API
Build Your Pipelines: Use sample patterns in your applications
Sample Index
Quick access to all CV-CUDA sample documentation.
Applications
See Applications Overview for an overview of the application samples.
Operators
- adaptivethreshold
- advcvtcolor
- averageblur
- bilateral_filter
- bndbox
- boxblur
- brightness_contrast
- center_crop
- channelreorder
- clahe
- color_twist
- composite
- conv2d
- convertto
- copymakeborder
- crop_flip_normalize_reformat
- customcrop
- cvtcolor
- erase
- flip
- gamma_contrast
- gaussian
- gaussiannoise
- histogrameq
- hq_resize
- inpaint
- joint_bilateral_filter
- label
- laplacian
- median_blur
- morphology
- normalize
- osd
- pillowresize
- random_resized_crop
- reformat
- remap
- resize
- resize_crop_convert_reformat
- rotate
- stack
- threshold
- warp_affine
- warp_perspective
Interoperability
See Interoperability Overview for an overview of the interoperability samples.
Common Utilities
Additional Resources
Common Utilities - Shared helper functions reference
Python API - Core API reference
Installation Guide - Build and setup instructions
GitHub Repository - Source code and issue tracker
Discussions - Ask questions and share use cases