Skip to content

Add paddle humanseg demo#20290

Merged
alalek merged 11 commits intoopencv:masterfrom
wjj19950828:add_paddle_humanseg_demo
Sep 27, 2021
Merged

Add paddle humanseg demo#20290
alalek merged 11 commits intoopencv:masterfrom
wjj19950828:add_paddle_humanseg_demo

Conversation

@wjj19950828
Copy link
Copy Markdown
Contributor

@wjj19950828 wjj19950828 commented Jun 21, 2021

Pull Request Readiness Checklist

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 other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to 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

This PR do follow contributes

1、fixed opencv.dnn resize && upsample op,support interp_mode == "half_pixel" situation.if not fixed,the onnx and dnn result has diff.
2、add PaddleSeg Portrait Segmentation demo by OpenCV.
3、fixed paddle_resnet50.py bug,change function name:mobilenetv2 to resnet50.
4、update readme.

Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

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

Great contribution!

Please take a look on notes below.


### Portrait segmentation visualization

<img src="./data/human_image.jpg" width="50%" height="50%"><img src="./data/result_test_human.png" width="50%" height="50%">
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Used images should be properly licensed.
Please provide information where did you get this image? (dataset, its license)

* 2. Preprocess image file and do inference.
* 3. Postprocess image file and visualization.

The result is in the path `data/result_test_human.png` .
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

.png files should be avoided in documentation (it is lossless format which provides huge files).
Consider using .jpg image format in documentation.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What is about the source of used image?

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.

The source of used image comes from Supervise.ly dataset,it is noted in the last line of the readme~

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Used images should have proper licensing terms. Do you have a link on them?

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.

The sample image comes from supervisely-ecosystem/persons,it's publicly available and free for academic purposes, and there's no license announcement for the dataset. Do you have any suggestions~

Comment on lines +3 to +4
import cv2 as cv
import numpy as np
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please put numpy import before cv2 (there are several reports where importing cv2 is broken without numpy).

@wjj19950828 wjj19950828 changed the base branch from master to 3.4 June 28, 2021 03:46
@vpisarev vpisarev changed the base branch from 3.4 to master July 13, 2021 18:59
@asmorkalov
Copy link
Copy Markdown
Contributor

@wjj19950828 Friendly reminder.

@wjj19950828
Copy link
Copy Markdown
Contributor Author

wjj19950828 commented Aug 22, 2021

@alalek,I have updated my PR based on your suggestions. Do you have any suggestions for related test cases?

Looking forward to it your reply~

@@ -1,6 +1,6 @@
# Run PaddlePaddle model by OpenCV
# Run PaddlePaddle model using OpenCV
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/cc @jiangjiajun As previous contributor please take a quick look on updates of PaddlePaddle samples.

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.

I have reviewed this change before, @wjj19950828 fix some grammer problems for my pull request

@vpisarev
Copy link
Copy Markdown
Contributor

@wjj19950828,
I wonder, if it's possible to replace human_image.jpg with some file that you (or your company) captured yourself and give full right to use it?

@sturkmen72
Copy link
Copy Markdown
Contributor

@wjj19950828
Copy link
Copy Markdown
Contributor Author

@wjj19950828, @vpisarev what about using https://github.com/opencv/opencv/blob/master/samples/data/messi5.jpg

This is a good suggestion, I will replace it with this picture~

@wjj19950828
Copy link
Copy Markdown
Contributor Author

@alalek Hi~is there anything else that needs to be modified in this PR, can you help me review it again?

Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

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

Well done! Thank you for contribution 👍

@alalek alalek merged commit 8fa8d47 into opencv:master Sep 27, 2021
@alalek alalek mentioned this pull request Oct 15, 2021
a-sajjad72 pushed a commit to a-sajjad72/opencv that referenced this pull request Mar 30, 2023
…demo

Add paddle humanseg demo

* fixed onnx resize op bug

* add humanseg demo for PaddlePaddle sample

* update README.md and flake8 format

* update func name

* update README.md for enviroment setup

* update README.md in the way install paddle2onnx

* update README.md

* update README.md

* add paddleseg in requirements.txt

* deal with comments

* replace picture
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants