Skip to content

Updated openpose sample to run using onnx#25593

Closed
gursimarsingh wants to merge 4 commits intoopencv:5.xfrom
gursimarsingh:improved_openpose_sample
Closed

Updated openpose sample to run using onnx#25593
gursimarsingh wants to merge 4 commits intoopencv:5.xfrom
gursimarsingh:improved_openpose_sample

Conversation

@gursimarsingh
Copy link
Copy Markdown
Contributor

Pull Request Readiness Checklist

#25006 #25314

openpose dnn sample has been renamed to human_pose and now supports onnx model. Steps for converting the model from caffe to onnx have been added in the description

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • 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
  • 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

Comment on lines +111 to +115
Mat blob = blobFromImage(img, scale, Size(W_in, H_in), Scalar(0, 0, 0), false, false);

std::vector<int> order = {0, 2, 3, 1};
Mat outBlob; // inp: NCHW, out: NHWC
transposeND(blob, order, outBlob);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is blobFromImageWithParams: https://docs.opencv.org/5.x/d6/d0f/group__dnn.html#gadc12e5f4a801fd3c1d802f4c8c5d311c. It handles NCHW -> NHWC conversion too.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed @asmorkalov

@gursimarsingh gursimarsingh requested a review from asmorkalov June 6, 2024 13:13
@asmorkalov
Copy link
Copy Markdown
Contributor

The core team decided not to drop Caffe support in 5.0, but mark it deprecated. I proposed to presume the original code unchanged. Closed for now.

@asmorkalov asmorkalov closed this Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants