dnn: add a human parsing cpp sample#17424
Merged
opencv-pushbot merged 1 commit intoopencv:3.4from Jun 1, 2020
Merged
Conversation
09fd7b1 to
0e6cb54
Compare
0e6cb54 to
bd5eca0
Compare
l-bat
reviewed
May 30, 2020
samples/dnn/human_parsing.cpp
Outdated
|
|
||
| static Mat parse_human(const std::string &image, const std::string &model, int backend=dnn::DNN_BACKEND_DEFAULT, int target=dnn::DNN_TARGET_CPU) { | ||
| // this network expects an image and a flipped copy | ||
| Mat input = imread(image); |
Contributor
There was a problem hiding this comment.
I think it’s better to read image in main() because we want to use parse_human() in other samples
samples/dnn/human_parsing.cpp
Outdated
Comment on lines
+8
to
+12
| #include <opencv2/core.hpp> | ||
| #include <opencv2/dnn.hpp> | ||
| #include <opencv2/highgui.hpp> | ||
| #include <opencv2/imgproc.hpp> | ||
| #include <opencv2/imgcodecs.hpp> |
Contributor
There was a problem hiding this comment.
Why do we need to include opencv2/core.hpp and opencv2/imgcodecs.hpp?
samples/dnn/human_parsing.cpp
Outdated
|
|
||
| Mat segm = parse_human(image, model, backend, target); | ||
|
|
||
| imwrite("human.png", segm); |
Contributor
There was a problem hiding this comment.
imshow is enough, imwrite is not needed
bd5eca0 to
82fee05
Compare
Contributor
|
I think this PR should go into 3.4 |
42b4ab2 to
129e922
Compare
129e922 to
09acd47
Compare
Merged
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.
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
should this go into 3.4 or master ?