Skip to content
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

Async Impl #101

Merged
merged 134 commits into from
Jul 2, 2024
Merged

Async Impl #101

merged 134 commits into from
Jul 2, 2024

Conversation

rainyl
Copy link
Owner

@rainyl rainyl commented Jun 16, 2024

Tasks
  • TODO: new library or mix to current?
  • add extra parameter callback to existed functions or add new functions? new functions, e.g., CvStatus Mat_New_Async(MatCallback callback);
  • modules
    • core
    • calib3d
    • contrib
    • dnn
    • features2d
    • gapi TOD: too much works, add in the future
    • highgui
    • imgproc
    • imgcodecs
    • objdetect
    • photo
    • stitching
    • svd
    • video
  • bump opencv.full to 4.10.0+3

@rainyl rainyl linked an issue Jun 19, 2024 that may be closed by this pull request
@rainyl
Copy link
Owner Author

rainyl commented Jun 22, 2024

So it works, but just need to rewrite nearly every API.

Future<(cv.Mat, cv.Mat)> heavyTaskAsync(cv.Mat im) async {
late cv.Mat gray, blur;
for (var i = 0; i < 1000; i++) {
gray = await cv.cvtColorAsync(im, cv.COLOR_BGR2GRAY);
blur = await cv.gaussianBlurAsync(im, (7, 7), 2, sigmaY: 2);
}
return (gray, blur);
}

async_example

@codecov-commenter
Copy link

codecov-commenter commented Jun 24, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 92.87824% with 217 lines in your changes missing coverage. Please review.

Project coverage is 91.38%. Comparing base (b16eb1b) to head (26f3b2c).
Report is 3 commits behind head on main.

Files Patch % Lines
lib/src/core/core_async.dart 88.74% 34 Missing ⚠️
lib/src/dnn/dnn_async.dart 85.26% 28 Missing ⚠️
lib/src/gapi/gcomputation.dart 28.57% 25 Missing ⚠️
lib/src/imgproc/imgproc_async.dart 93.96% 23 Missing ⚠️
lib/src/features2d/features2d_async.dart 93.98% 11 Missing ⚠️
lib/src/features2d/features2d.dart 83.67% 8 Missing ⚠️
lib/src/objdetect/objdetect_async.dart 97.75% 8 Missing ⚠️
lib/src/core/mat_async.dart 85.71% 7 Missing ⚠️
lib/src/gapi/gmat.dart 61.11% 7 Missing ⚠️
lib/src/gapi/gscalar.dart 66.66% 7 Missing ⚠️
... and 19 more

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #101      +/-   ##
==========================================
+ Coverage   90.36%   91.38%   +1.02%     
==========================================
  Files          35       57      +22     
  Lines        5322     7828    +2506     
==========================================
+ Hits         4809     7154    +2345     
- Misses        513      674     +161     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@abdelaziz-mahdy
Copy link
Contributor

abdelaziz-mahdy commented Jun 24, 2024

i just saw it, i will try to implement what i can and open a pr to this pr branch, can we spilt the modules so i handle some and you handle some to avoid we both implementing the same things?

also whats the easiest module i can follow as a reference since this pr has the alot of changes, so an easy module to follow will be the best option

@rainyl
Copy link
Owner Author

rainyl commented Jun 24, 2024

i just saw it, i will try to implement what i can and open a pr to this pr branch, can we spilt the modules so i handle some and you handle some to avoid we both implementing the same things?

Sure, just create a new branch from async branch

also whats the easiest module i can follow as a reference since this pr has the alot of changes, so an easy module to follow will be the best option

For now I just implemented calib3d and imgcodecs, I think imgcodecs is the easiest, just several API in it, but remember to take a loot at core/types.h, in which many basic definitions inside it.

@rainyl
Copy link
Owner Author

rainyl commented Jun 24, 2024

@abdelaziz-mahdy I have added async version of SVD, hope you are not doing the same module, may I ask which module are you working (or planning working) on?

Besides, if you finish some module, please open a PR to async branch.

@abdelaziz-mahdy
Copy link
Contributor

abdelaziz-mahdy commented Jun 24, 2024

I think dnn or objdetect, and if I faced any problem will let you know

For pr, deal will do so

@rainyl
Copy link
Owner Author

rainyl commented Jul 2, 2024

@abdelaziz-mahdy I think it's time to merge, thanks for your efforts!

@rainyl rainyl merged commit 03127a3 into main Jul 2, 2024
9 of 13 checks passed
@abdelaziz-mahdy
Copy link
Contributor

@abdelaziz-mahdy I think it's time to merge, thanks for your efforts!

Thank you for everything 💖

@rainyl rainyl deleted the async branch July 3, 2024 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Async support
3 participants