Change classic caffe models related tests and samples to onnx format#25548
Closed
WanliZhong wants to merge 9 commits intoopencv:5.xfrom
Closed
Change classic caffe models related tests and samples to onnx format#25548WanliZhong wants to merge 9 commits intoopencv:5.xfrom
WanliZhong wants to merge 9 commits intoopencv:5.xfrom
Conversation
18 tasks
Member
Author
|
If I missed some models. Please remind me. |
1fc0bba to
cfc083d
Compare
WanliZhong
commented
May 17, 2024
Comment on lines
+158
to
+171
| class DNNOnnxModel(Framework): | ||
| net = object | ||
|
|
||
| def __init__(self, onnx_file, in_blob_name, out_blob_name): | ||
| self.net = cv.dnn.readNetFromONNX(onnx_file) | ||
| self.in_blob_name = in_blob_name | ||
| self.out_blob_name = out_blob_name | ||
|
|
||
| def get_name(self): | ||
| return 'DNN (ONNX)' | ||
|
|
||
| def get_output(self, input_blob): | ||
| self.net.setInput(input_blob, self.in_blob_name) | ||
| return self.net.forward(self.out_blob_name) |
Member
Author
There was a problem hiding this comment.
This change is introduced from 4.x in https://github.com/opencv/opencv/pull/25435/files#diff-0f1c399b5f2a43b1c9501dd5fc4d97ae8306099eda327d3096cd84f5b22f2e9f
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merge with: opencv/opencv_extra#1175
Part of #25314
This PR aims to change the tests and samples related to
alexnet,densenet,googlenet,squeezenet,resnet-50models from caffe framework to onnx. Tests intest_int8_layer.cppandtest_caffe_importer.cppwill be removed in #25323NOTE:
Error:
RuntimeError: Out of bounds memoryPull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.