Skip to content

Fix problems in tutorial and python sample of dnn_face. #20935

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

Merged
merged 3 commits into from
Oct 27, 2021

Conversation

crywang
Copy link
Contributor

@crywang crywang commented Oct 25, 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

@crywang crywang changed the title Fix problems in tutorial and python sample. Fix problems in tutorial and python sample of dnn_face. Oct 25, 2021
@asmorkalov
Copy link
Contributor

@crywang Thanks for the contribution! The best solution for code snippets in documentation is substitution from existing sample code. Samples are built by CI and syntax checks happen for documentation too. I propose to use samples/dnn/face_match.cpp sample for code snippets.
See:

@asmorkalov asmorkalov added category: documentation Documentation fix or update incomplete labels Oct 25, 2021
@alalek
Copy link
Member

alalek commented Oct 25, 2021

samples/dnn/face_match.cpp

documentation code snippets should go to samples/cpp/tutorial_code/<module>.

BTW, Regular samples should be "full featured", e.g, provide useful result.

@alalek alalek mentioned this pull request Oct 27, 2021
6 tasks
@alalek
Copy link
Member

alalek commented Oct 27, 2021

I believe we can merge this "as is" and improve this later ( /cc @fengyuentau )

@alalek alalek merged commit 244ba1a into opencv:master Oct 27, 2021
@crywang
Copy link
Contributor Author

crywang commented Oct 27, 2021

I am confident that the document and sample codes will be improved in the near future according to the suggestions raised by @asmorkalov and @alalek.

@fengyuentau
Copy link
Member

@alalek , do you suggest we should move code snippets (face_detect.cpp, face_detect.py, face_match.cpp, face_match.py in samples/dnn) to sameples/cpp/tutorial_code/objdetect?

BTW, I think our samples are already "full featured" according to your perspective. Correct me if I misunderstand something.

Comment on lines 60 to +62
```cpp
// Initialize FaceRecognizer with model path (cv::String)
Ptr<FaceRecognizer> faceRecognizer = FaceRecognizer::create(model_path, "");
// Initialize FaceRecognizerSF with model path (cv::String)
Ptr<FaceRecognizerSF> faceRecognizer = FaceRecognizerSF::create(model_path, "");
Copy link
Member

Choose a reason for hiding this comment

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

This content should be moved to .cpp files (to be checked through compiler run).

@sturkmen72 sturkmen72 mentioned this pull request Oct 27, 2021
6 tasks
@alalek alalek mentioned this pull request Dec 30, 2021
@alalek alalek mentioned this pull request Feb 22, 2022
a-sajjad72 pushed a commit to a-sajjad72/opencv that referenced this pull request Mar 30, 2023
Fix problems in tutorial and python sample of dnn_face.

* Update dnn_face.markdown

* Update face_match.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants