Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork56.4k
DNN: Add New API blobFromImageParam#22750
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
7b47836 toe4abcecCompare60209c1 tod280eabComparezihaomu commentedNov 24, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Hi, the updated code has re-used old blobFromImage API, only change is convert scalefactor from Is there any solution? |
a5c6ceb to520b472CompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
alalek left a comment
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.
As we have a new version with "parameters" do we really need to update old versionsblobFromImage()? We could deprecate them and suggest using a new variant.
Uh oh!
There was an error while loading.Please reload this page.
asmorkalov commentedNov 25, 2022
You can generate extra overloads in Java with ManualFuncs option of Java bindigs generator. See modules/core/misc/java/gen_dict.json as example. Java tests for all manual functions are required. |
b80264b to716ba23Compare972d8ce to12acf76CompareblobFromImage through New APIblobFromImageParamblobFromImage through New APIblobFromImageParamzihaomu commentedFeb 15, 2023
Agree with@alalek. I propose that this PR only add new features to the new API |
12acf76 toa58ce0cCompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
asmorkalov commentedMar 22, 2023
6816dbd to5c0ed4fCompareUh oh!
There was an error while loading.Please reload this page.
b386d90 to957cd82CompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
957cd82 tob4f6383Compare
asmorkalov left a comment
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.
👍
vpisarev commentedApr 19, 2023
@dkurt, can you please tell if "planar" layout used in TFLite importer is the same thing as "ND" layout used in other formats? |
dkurt commentedApr 19, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Do we really need to introduce legacy TensorFlow NHWC data layout? I think it may introduce more confusion than strict NCHW input. Also, I'm not sure about preserving ratio during scale (crop/letter_box). They are different in different applications. For example, EfficientDet from TensorFlow: h,w=img.shape[0:2]# 1. Resize and keep aspect ratioassert(w>=h)h=int(h/w*args.height)inp=cv.resize(img.astype(np.float32), (args.width,h))# It's important to perform resize for fp32# 2. Zero padding to the bottominp=np.pad(inp, ((0,args.height-h), (0,0), (0,0)),'constant')inp=np.expand_dims(inp.transpose(2,0,1),axis=0)
@vpisarev, TFLite's planar is the same as TensorFlow's planar. It's used in case of 4D->3D or 2D reshaping when OpenCV data layout matches TensorFlow during import. |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
a8c3f22 to30aeda5Compareasmorkalov commentedApr 21, 2023
|
30aeda5 to9450d87Comparezihaomu commentedApr 21, 2023
Hi@asmorkalov, thanks for your reminder, updated. |
DNN: Add New API blobFromImageParamopencv#22750The purpose of this PR:1. Add new API `blobFromImageParam` to extend `blobFromImage` API. It can support the different data layout (NCHW or NHWC), and letter_box.2. ~~`blobFromImage` can output `CV_16F`~~### Pull Request Readiness ChecklistSee details athttps://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request- [x] I agree to contribute to the project under Apache 2 License.- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV- [x] The PR is proposed to the proper branch- [ ] There is a reference to the original bug report and related work- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name.- [ ] The feature is well documented and sample code can be built with the project CMake
DNN: Add New API blobFromImageParamopencv#22750The purpose of this PR:1. Add new API `blobFromImageParam` to extend `blobFromImage` API. It can support the different data layout (NCHW or NHWC), and letter_box.2. ~~`blobFromImage` can output `CV_16F`~~### Pull Request Readiness ChecklistSee details athttps://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request- [x] I agree to contribute to the project under Apache 2 License.- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV- [x] The PR is proposed to the proper branch- [ ] There is a reference to the original bug report and related work- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name.- [ ] The feature is well documented and sample code can be built with the project CMake
Uh oh!
There was an error while loading.Please reload this page.
The purpose of this PR:
blobFromImageParamto extendblobFromImageAPI. It can support the different datalayout (NCHW or NHWC), and letter_box.blobFromImagecan outputCV_16FPull Request Readiness Checklist
See details athttps://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.