Package for PIV data analysis
Project description
PyTorch accelerated Particle Image Velocimetry
This program implements the basic algorithms of the PIV method, such as an iterative cross-correlation method based on FFT with an integer and continuous displacement (DWS, CWS) of the interrogation windows, filtering and interpolation of the pair loss effect, and so on. At this stage, the graphical interface is available, the ability to select PIV hyperparameters. The key feature of the project is the use of graphics accelerators due to the torch library. PIV algorithm is completely vectorized, what results in a very high performance using the GPU, but still has a room for improvement.
Parameters of the program:
- Interrogation window size
- Window overlap size
- Coordinate scale
- Time between frames
- Selection of the device (CPU or any of your GPUs)
- Iteration method: DWS or CWS
- The number of iterations of the algorithm
- Interrogation window scale during iterations
- Supported image formats (bmp, jpg, tiff, ect.)
- Options for saving program results
Installation:
It is easier to use conda environment.
- Install nvidia CUDA Toolkit https://developer.nvidia.com/cuda-toolkit to ensure latest nvidia driver usage
- Install pytorch with GPU support https://pytorch.org/ . Matching your CUDA version is not critical since PyTorch installs it's own cudatoolkit.
- In your environment or command line
pip install TorchPIV
Usage:
Start GUI version from terminal
python
import torchPIV
torchPIV.runGUI()
Tested on Windows
Performance:
This method allows processing 4 thousand pairs of images with a size of 4 MP each with a search window of 64, overlap of 50%, two iterations with re-arranging (an increase in the number of vectors by 4 times) in less than 10 minutes. The first iteration of the algorithm (~[4000, 64, 64] subimage tensor) takes ~15 ms on a Geforce GTX 1660 Ti GPU.
Futhure plans: Creating a version of the program for processing data during their recording. The ability to process stereo PIV data.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.