Skip to content

G-API-NG/Docs: Added a tutorial page on interactive face detection sample#16039

Merged
alalek merged 3 commits intoopencv:masterfrom
dmatveev:dm/gapi_tutorial_interactive_face_detection
Dec 9, 2019
Merged

G-API-NG/Docs: Added a tutorial page on interactive face detection sample#16039
alalek merged 3 commits intoopencv:masterfrom
dmatveev:dm/gapi_tutorial_interactive_face_detection

Conversation

@dmatveev
Copy link
Copy Markdown
Contributor

@dmatveev dmatveev commented Dec 2, 2019

  • Introduced a "--ser" option to run the pipeline serially for
    benchmarking purposes
  • Reorganized sample code to better fit the documentation;
  • Fixed a couple of issues (mainly typos) in the public headers
force_builders=Custom,Custom Win,Custom Mac
build_image:Custom=ubuntu-openvino-2019r2.0:16.04
build_image:Custom Win=openvino-2019r2.0
build_image:Custom Mac=openvino-2019r2.0

test_modules:Custom=gapi
test_modules:Custom Win=gapi
test_modules:Custom Mac=gapi

buildworker:Custom=linux-1
test_opencl:Custom=ON
test_bigdata:Custom=1
test_filter:Custom=*

build_gapi_standalone:Linux x64=ade-0.1.1f
build_gapi_standalone:Win64=ade-0.1.1f
build_gapi_standalone:Mac=ade-0.1.1f
build_gapi_standalone:Linux x64 Debug=ade-0.1.1f
build_gapi_standalone:Custom Win=ade-0.1.1f

@dmatveev dmatveev added this to the 4.x milestone Dec 2, 2019
@dmatveev
Copy link
Copy Markdown
Contributor Author

dmatveev commented Dec 2, 2019

@dkurt @smirnov-alexey would you guys mind reviewing it? Thanks!

@dmatveev
Copy link
Copy Markdown
Contributor Author

dmatveev commented Dec 2, 2019

@OrestChura FYI

…mple

- Introduced a "--ser" option to run the pipeline serially for
  benchmarking purposes
- Reorganized sample code to better fit the documentation;
- Fixed a couple of issues (mainly typos) in the public headers
@dmatveev dmatveev force-pushed the dm/gapi_tutorial_interactive_face_detection branch from 229135f to 6390b11 Compare December 3, 2019 19:36
@dmatveev
Copy link
Copy Markdown
Contributor Author

dmatveev commented Dec 4, 2019

@OrestChura @smirnov-alexey any updates with the review?

Copy link
Copy Markdown
Contributor

@smirnov-alexey smirnov-alexey left a comment

Choose a reason for hiding this comment

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

Overall looks fine

@dmatveev
Copy link
Copy Markdown
Contributor Author

dmatveev commented Dec 5, 2019

@smirnov-alexey thanks for review, your comments are addressed. @dkurt is there anything to add? I am about to merge this already

@dkurt
Copy link
Copy Markdown
Member

dkurt commented Dec 6, 2019

Do you mind if I will experiment a bit with DOT diagrams in doxygen? It seems to me we can reaplace a .png image to a text graph.

@dmatveev
Copy link
Copy Markdown
Contributor Author

dmatveev commented Dec 6, 2019

@dkurt then this needs to be done for all tutorials which are in progress :(

@dkurt
Copy link
Copy Markdown
Member

dkurt commented Dec 6, 2019

So, the following code can generate similar graph but still remain some gaps (subgraph's border, label and crossing edge):

         * @dot
         *  digraph pipeline {
         *      node [shape=record fontname=Helvetica fontsize=10 style=filled color="#4c7aa4" fillcolor="#5b9bd5" fontcolor="white"];
         *      edge [color="#62a8e7"];
         *      splines=ortho;
         *      capture [label="Capture\nDecode" pos="1,2"];
         *      resize [label="Resize\nConvert"  pos="2,2"];
         *      detect [label="Detect faces"];
         *      show [label="Visualize\nDisplay"];
         *      temp_3 [style=invis shape=point width=0];
         *      subgraph cluster_1 {
         *        label="for each face";
         *        postproc_1 [label="Crop\nResize\nConvert"];
         *        postproc_2 [label="Crop\nResize\nConvert"];
         *        age_gender [label="Classify\nAge/gender"];
         *        emo [label="Classify\nEmotions"];
         *        temp_1 [style=invis shape=point width=0];
         *        temp_2 [style=invis shape=point width=0];
         *      }
         *      { rank=same; capture resize detect temp_1 postproc_1 age_gender temp_3 show }
         *      { rank=same; temp_2 postproc_2 emo }
         *      capture -> resize -> detect
         *      detect -> temp_1 [arrowhead=none]
         *      temp_1 -> postproc_1 -> age_gender
         *      temp_1 -> temp_2 [arrowhead=none]
         *      capture -> temp_2 [arrowhead=none]
         *      temp_2 -> postproc_2 -> emo
         *      capture -> postproc_1

         *      age_gender -> temp_3 [arrowhead=none]
         *      emo -> temp_3 [arrowhead=none]
         *      temp_3 -> show

         *      edge[style=invis];
         *      postproc_1 -> postproc_2
         *      age_gender -> emo
         *  }
         * @enddot

image

@dmatveev
Copy link
Copy Markdown
Contributor Author

dmatveev commented Dec 6, 2019

@dkurt
Copy link
Copy Markdown
Member

dkurt commented Dec 6, 2019

@dmatveev, thanks! Much more closer:
image

         * @dot
         *  digraph pipeline {
         *      node [shape=record fontname=Helvetica fontsize=10 style=filled color="#4c7aa4" fillcolor="#5b9bd5" fontcolor="white"];
         *      edge [color="#62a8e7"];
         *      splines=ortho;
         *      capture [label="Capture\nDecode"];
         *      resize [label="Resize\nConvert"];
         *      detect [label="Detect faces"];
         *      show [label="Visualize\nDisplay"];
         *      temp_3 [style=invis shape=point width=0];
         *      subgraph cluster_tmp {
         *        graph[style=dashed];
         *        postproc_1 [label="Crop\nResize\nConvert"];
         *        postproc_2 [label="Crop\nResize\nConvert"];
         *        age_gender [label="Classify\nAge/gender"];
         *        emo [label="Classify\nEmotions"];
         *        temp_1 [style=invis shape=point width=0];
         *        temp_2 [style=invis shape=point width=0];
         *        { rank=same; temp_2 postproc_2 emo }
         *        label="(for each face)";
         *      }
         *      { rank=same; capture resize detect temp_1 postproc_1 age_gender temp_3 show }
         *      capture -> resize -> detect
         *      detect -> temp_1 [arrowhead=none]
         *      temp_1 -> postproc_1 -> age_gender
         *      temp_1 -> temp_2 [arrowhead=none]
         *      capture -> temp_2 [arrowhead=none]
         *      temp_2 -> postproc_2 -> emo
         *      capture -> postproc_1

         *      age_gender -> temp_3 [arrowhead=none]
         *      emo -> temp_3 [arrowhead=none]
         *      temp_3 -> show

         *      edge[style=invis];
         *      postproc_1 -> postproc_2
         *      age_gender -> emo
         *  }
         * @enddot

@dmatveev
Copy link
Copy Markdown
Contributor Author

dmatveev commented Dec 6, 2019

@dkurt this is cool! can you please also put crop/resise->age/gender path to that cluster as well? Then it will be a 1:1

@dkurt
Copy link
Copy Markdown
Member

dkurt commented Dec 7, 2019

@dmatveev, Done. May I ask you to try this graph instead of a png image?

tmp

source:

digraph pipeline {
  node [shape=record fontname=Helvetica fontsize=10 style=filled color="#4c7aa4" fillcolor="#5b9bd5" fontcolor="white"];
  edge [color="#62a8e7"];
  splines=ortho;

  rankdir = LR;
  subgraph cluster_0 {
    color=invis;
    capture [label="Capture\nDecode"];
    resize [label="Resize\nConvert"];
    detect [label="Detect faces"];
    capture -> resize -> detect
  }

  subgraph cluster_1 {
    graph[style=dashed];

    subgraph cluster_2 {
      color=invis;
      temp_4 [style=invis shape=point width=0];
      postproc_1 [label="Crop\nResize\nConvert"];
      age_gender [label="Classify\nAge/gender"];
      postproc_1 -> age_gender [constraint=true]
      temp_4 -> postproc_1 [constraint=none]
    }

    subgraph cluster_3 {
      color=invis;
      postproc_2 [label="Crop\nResize\nConvert"];
      emo [label="Classify\nEmotions"];
      postproc_2 -> emo [constraint=true]
    }
    label="(for each face)";
  }

  temp_1 [style=invis shape=point width=0];
  temp_2 [style=invis shape=point width=0];
  detect -> temp_1 [arrowhead=none]
  temp_1 -> postproc_1

  capture -> {temp_4, temp_2} [arrowhead=none constraint=false]
  temp_2 -> postproc_2

  temp_1 -> temp_2 [arrowhead=none constraint=false]

  temp_3 [style=invis shape=point width=0];
  show [label="Visualize\nDisplay"];

  {age_gender, emo} -> temp_3 [arrowhead=none]
  temp_3 -> show
}

@dmatveev
Copy link
Copy Markdown
Contributor Author

dmatveev commented Dec 9, 2019

@dkurt done, thanks! For some reason, however, in both Firefox and Chromium it looks like this for me now:

image

Clicking the arrow button at the right opens a valid svg diagram

@dkurt
Copy link
Copy Markdown
Member

dkurt commented Dec 9, 2019

@dmatveev, Yeah, I also faced this problem. However it works fine in case of

cd opencv_build/doc/doxygen/html
python -m SimpleHTTPServer

and then go to localhost:8000

@dmatveev dmatveev force-pushed the dm/gapi_tutorial_interactive_face_detection branch from 3b31415 to e2c3934 Compare December 9, 2019 12:13
@dmatveev
Copy link
Copy Markdown
Contributor Author

dmatveev commented Dec 9, 2019

@dkurt I believe that local HTML documentation shouldn't require running a server to view that :) Worked for me with this change in Doxyfile.in.

INTERACTIVE_SVG        = NO

I couldn't find any other usages of DOT/SVG in the repo, so @alalek if this works...

DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = svg
INTERACTIVE_SVG = YES
INTERACTIVE_SVG = NO
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.

Great! I couldn't find it :)

@dmatveev
Copy link
Copy Markdown
Contributor Author

dmatveev commented Dec 9, 2019

@OrestChura I believe you will have to do something similar with #15942

Copy link
Copy Markdown
Member

@dkurt dkurt left a comment

Choose a reason for hiding this comment

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

👍 Thanks!

@dkurt dkurt self-assigned this Dec 9, 2019
@alalek alalek merged commit c89780d into opencv:master Dec 9, 2019
@dmatveev
Copy link
Copy Markdown
Contributor Author

Great, thanks!!

a-sajjad72 pushed a commit to a-sajjad72/opencv that referenced this pull request Mar 30, 2023
…ctive_face_detection

* G-API-NG/Docs: Added a tutorial page on interactive face detection sample

- Introduced a "--ser" option to run the pipeline serially for
  benchmarking purposes
- Reorganized sample code to better fit the documentation;
- Fixed a couple of issues (mainly typos) in the public headers

* G-API-NG/Docs: Reflected meta-less compilation in new G-API tutorial

* G-API-NG/Docs: Addressed review comments on Face Analytics Pipeline example
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