localdevices / pyorc

Surface velocity, object tracking, and river flow measurements in an open-source API
GNU Affero General Public License v3.0
129 stars 31 forks source link

cross correlation acceleration #159

Open hcwinsemius opened 3 months ago

hcwinsemius commented 3 months ago

Move cross correlation methods to numba with jitted code base

alexlib commented 3 months ago

Move cross correlation methods to numba with jitted code base

I'd be happy to see your implementation and consider it for openpiv-python

hcwinsemius commented 2 months ago

Move cross correlation methods to numba with jitted code base

I'd be happy to see your implementation and consider it for openpiv-python

Thanks @alexlib. I ran a number of tests with a parallelized numba implementation of the cross correlation. This seemed to speedup the cross correlation by a factor 10 (a little bit dependent on what the dimensions of the problem exactly are). The reorganization into velocity vectors did not yet give faster results, but I am not through testing yet. At least this is on the schedule for implementation. We can consider it for openpiv e.g. by providing an engine keyword which defaults to numpy, but when set to engine="numba" uses numba instead. In the dependencies a [numba] optional dependencies section could be created so that you can always keep on using openpiv with only numpy.

alexlib commented 2 months ago

Move cross correlation methods to numba with jitted code base

I'd be happy to see your implementation and consider it for openpiv-python

Thanks @alexlib. I ran a number of tests with a parallelized numba implementation of the cross correlation. This seemed to speedup the cross correlation by a factor 10 (a little bit dependent on what the dimensions of the problem exactly are). The reorganization into velocity vectors did not yet give faster results, but I am not through testing yet. At least this is on the schedule for implementation. We can consider it for openpiv e.g. by providing an engine keyword which defaults to numpy, but when set to engine="numba" uses numba instead. In the dependencies a [numba] optional dependencies section could be created so that you can always keep on using openpiv with only numpy.

This idea would be great - I haven't learned yet how to design the code with the "options".