-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Speed-up bitmap operations on images. Fixes #5856 #5857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Speed-up bitmap operations on images. Fixes #5856 #5857
Conversation
- Speed-up operations avoiding to use the very slow functions GetPixel and SetPixel. Implemented raw access to bitmap data. Signed-off-by: darth-vader-lg <[email protected]>
Signed-off-by: darth-vader-lg <[email protected]>
Hello @michaelgsharp, Sorry me, but I'm having some problems with the repository CI Checks. It seems to be caused by an Internal error. Are you maybe doing some maintenance to the system now? Or there is something that I need to do with this PR? Kind Regards. |
@darth-vader-lg: I restarted the CI tests. Hopefully it was a transient problem. |
- It was passed ImageLockMode.ReadOnly where it was needed a write operation. Signed-off-by: darth-vader-lg <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #5857 +/- ##
=======================================
Coverage 68.35% 68.35%
=======================================
Files 1134 1134
Lines 241910 241942 +32
Branches 25289 25292 +3
=======================================
+ Hits 165347 165373 +26
- Misses 69919 69923 +4
- Partials 6644 6646 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This is the final version of the PR. |
@darth-vader-lg this one also looks good. Just checking on a couple of things and I'll get this approved/merged in. If not tonight it will be tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks again for taking the time to do this!
@darth-vader-lg How did you learn all your optimization stuff? That is something I have been really interested in (in general, not specifically towards this project) but am not entirely sure where to start looking.
@michaelgsharp As I told You in the last PR, it’s just a professional mental disease contracted after working for more than 30 years in the automation field, PIDs and position control loops.
By the way, It was quite simple to do these few improvements, also because the framework is well written and tidy enough. I’m quite relatively new to this field but you better know how all these frameworks are still evolving and how the situation is such a mess, still now. But the current market is going for sure toward this direction plus/additionally the always needed "fast development and delivering timeline" to meet the competition requirements. In any case, if You need something, have ideas or proposals about your projects, feel free to write me an email. Have a nice day. |
* remotes/official/main: Update lgbm to v2.3.1 (dotnet#5851) Speed-up bitmap operations on images. Fixes dotnet#5856 (dotnet#5857) Onnx recursion limit (dotnet#5840) Speed up the inference of the saved_model(s). Fixes dotnet#5847 (dotnet#5848) Signed-off-by: darth-vader-lg <[email protected]>
Speed-up operations using raw access instead of very slow functions GetPixel and SetPixel.
Associated issue: #5856
I made this changes to make more fast the operations on the images, as explained in the issue #5856.
My approach is substituting all the very slow GetPixel and SetPixel functions with a raw access to the images data.
My test code is this:
but unluckily I cannot insert in the commit because it access to my local data (model and images).
The result of this changes is the improvement of speed dealing with images as described in my issue #5856.
If they are associated with my other PR #5848 / Issue #5847 they can improve the all the TF object detection system by ~396% (of course, measured on my device; it could be less or more in other devices).
Without optimizations (current)
With only image raw access optimization (Issue #5856 / PR #5857)
With TensorFlow and image raw access optimization (Issue #5847 / PR #5848 and Issue #5856 / PR #5857)