Repository navigation
Parallelize building kmeans index in flann - #3458
Conversation
There was a problem hiding this comment.
there is possible memory leak in case of exception. So, please, use cv::AutoBuffer<bool>, which is safer.
|
Hi @thorikawa, please:
|
- Use cv::AutoBuffer rather than new allocation - Fix "assignment operator could not be generated" warning
|
Hi @ilya-lavrenov, I have benchmarked it using this code and Caltech 101 dataset. Here is the summary. (All unit is millisecond) Benchmark1EnvironmentMac OS X 10.9.5 Beforepoly@Rewlloola:~/workspace/opencv-flann-kmeans-perf$ ./main my_101_list.txt Afterpoly@Rewlloola:~/workspace/opencv-flann-kmeans-perf$ ./main my_101_list.txt TIME_EXTRACT_FEATURES = 18885.3 Benchmark2EnvironmentAmazon Linux 2014.09.1 Before[ec2-user@ip-172-31-3-55 opencv-flann-kmeans-benchmark]$ ./main 101_list.txt After[ec2-user@ip-172-31-3-55 opencv-flann-kmeans-benchmark]$ LD_LIBRARY_PATH=/usr/local/opencv-3.0.0-beta/lib ./main 101_list.txt The amount of improvement depends on the number of cpus, but i would say it provides a lot of gains. |
|
Also I've fixed warnings. Please review it again. Thanks! |
|
👍 |
I improved k-means index in flann module by parallelize computing distances between datas and centers. It would be great if you have a chance to review and merge it. Thanks!