Comments (2)
Hi !
Thanks for taking the time to look this :) and for the numpy nms function
The discrepancy between the benchmarks in the readme indeed came from the number of trials which were too low in your case (number of cpu cores doesn't matter since neither numpy nor opencv seem to use multithreading here)
I updated your code (thanks again) to plot error bars, and to increase number of trials. I will integrate this in the colab notebook which holds the benchmarks visualizations. Here are the results I obtain on my laptop with a 12th Gen Intel(R) Core(TM) i7-1250U
cpu
One thing to note is that powerboxes nms scales particularly badly with the number of boxes compared to opencv, which in turn performs badly on a small number of boxes. The logic in opencv is quite different than what I implemented (actually it's adaptive nms). I will look into it and see if there's a way to take best of both approaches.
from powerboxes.
You are right about the threading. Numpy version is basically using vectorization to speedup the calculations. In fact, I tried Cython version of the same thing and yet numpy's native python implementation is twice as faster. Using jit (e.g. Jax or Numba) doesn't help either as the code cannot be parallelized efficiently.
As for OpenCV, it does uses adaptive NMS, however, implementation is unclear as I haven't seen the C++ code yet. Another thing is that OpenCV version of the code be further optimized using OPENCL or CUDA acceleration which is such a pain to setup in python.
What you have here (powerboxes) is a very well implemented and very efficient. Especially without threading, the performance is quite amazing.
from powerboxes.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from powerboxes.