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
Change classic caffe models related tests and samples to onnx format #25548
Open
WanliZhong
wants to merge
9
commits into
opencv:5.x
Choose a base branch
from
WanliZhong:simpleCaffeModel2onnx
base: 5.x
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
WanliZhong
added
test
category: samples
category: dnn
cleanup
Code cleanup (e.g, drop legacy C-API, legacy unmaintained code)
OpenCV5
labels
May 6, 2024
WanliZhong
changed the title
Change simple caffe models related tests and samples to onnx format
Change classic caffe models related tests and samples to onnx format
May 6, 2024
18 tasks
If I missed some models. Please remind me. |
WanliZhong
force-pushed
the
simpleCaffeModel2onnx
branch
from
May 17, 2024 08:13
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) |
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.
This change is introduced from 4.x in https://github.com/opencv/opencv/pull/25435/files#diff-0f1c399b5f2a43b1c9501dd5fc4d97ae8306099eda327d3096cd84f5b22f2e9f
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
category: dnn
category: samples
cleanup
Code cleanup (e.g, drop legacy C-API, legacy unmaintained code)
OpenCV5
test
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-50
models from caffe framework to onnx. Tests intest_int8_layer.cpp
andtest_caffe_importer.cpp
will be removed in #25323NOTE:
Error:
RuntimeError: Out of bounds memory
Pull 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.