Skip to content
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

Human pose estimation models update #1718

Merged
merged 58 commits into from
Nov 26, 2020

Conversation

druzhkov-paul
Copy link
Contributor

@druzhkov-paul druzhkov-paul commented Oct 30, 2020

This PR adds three new human-pose-estimation models. These models have architecture different from human-pose-estimation-0001, hence, a new Python demo and AC adapter has been added to support new model.

As for human-pose-estimation-0001, it's support has been added to the new Python demo as well. But I may suppose that a few clarifications are needed here:

  1. OMZ already has two implementations of a postprocessing stage for human-pose-estimation-0001: the one in a C++ demo and another one in a dedicated AC adapter (which is in Python). I assume that these two implementations are equivalent in terms of results. Though due to performance concerns some parameters differ in an AC config vs C++ demo application: for example featuremaps' upscaling factor.

  2. I've added an alternative Python implementation of postprocessing. It has a few advantages:

    • It is faster in a demo mode than current Python implementation from AC. C++ postprocessing is still faster, but not much.
    • It is more accurate, i.e. gives better metrics on a test dataset. See the table below.
    • It is aligned between the demo and AC.
  3. To compare the speed I've added C++ postprocessing with Python bindings (which is also used in human-pose-estimation-3d demo) support to the new demo application. Though I haven't exposed its selection to the demo's CLI. So it should be either made configurable, or removed at all. Let me know, what do you think about it.

AP on the test dataset:

Upscaling factor 1x 4x 8x original image scale
Current AC postprocessing 23.8 38.3 42.85 42.75
New postprocessing 39.1 41.1 43.2 --

TODOs:

  • Double check quality number after latest refactoring and clean up steps.
  • Decide what to do with C++ postprocessing (leave or drop).
  • AC config for human-pose-estimation-0001 with the new adapter has not been added. IMO, it can be added alongside the current one, rather than replace it, because new adapter is slow in that mode.

@eaidova eaidova added the model All about model, from enabling to issues label Oct 30, 2020
Copy link
Contributor

@vladimir-dudnik vladimir-dudnik left a comment

Choose a reason for hiding this comment

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

please adopt existing demo to work with new models and old model (if you not going to deprecate old model)

demos/python_demos/human_pose_estimation_demo/models.lst Outdated Show resolved Hide resolved
Copy link
Contributor

@vladimir-dudnik vladimir-dudnik left a comment

Choose a reason for hiding this comment

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

please remove empty sections from model descriptions.

@druzhkov-paul
Copy link
Contributor Author

It is not clear what we should decide "Decide what to do with C++ postprocessing (leave or drop)." There were no C++ postprocessing in this demo. We may consider to add this in future, no need to stop this PR because of that

This PR introduces a new demo, so for sure it had no C++ postprocessing earlier. And now it supports both Python and C++ postprocessing (the same as in human-pose-estimation-3d demo), but results and runtime differ. I'm Ok with dropping C++ postprocessing at all, this is just for your reference if you feel unsatisfied with Python postprocessing performance.

@vladimir-dudnik
Copy link
Contributor

@druzhkov-paul I'm ok to have only python implementation of postprocessing for the first release of this demo. we may think about optimization later

@druzhkov-paul
Copy link
Contributor Author

@druzhkov-paul I'm ok to have only python implementation of postprocessing for the first release of this demo. we may think about optimization later

Ok. Removed C++ postprocessing for now.

@vladimir-dudnik
Copy link
Contributor

please add soft link to AC config from old configs location

Copy link
Collaborator

@Wovchena Wovchena left a comment

Choose a reason for hiding this comment

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

Please add the new demo to the demos root readme. The rest looks fine.

demos/python_demos/human_pose_estimation_demo/README.md Outdated Show resolved Hide resolved
required=True, type=str)
args.add_argument('-m', '--model', help='Required. Path to an .xml file with a trained model.',
required=True, type=str)
args.add_argument('--type', choices=('ae', 'openpose'), required=True, type=str,
Copy link
Contributor

Choose a reason for hiding this comment

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

Please, rename this key to -at, --architecture_type. (see here)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Comment on lines +151 to +158
Modes.USER_SPECIFIED:
HPE(ie, args.model, target_size=args.tsize, device=args.device, plugin_config=config_user_specified,
results=completed_request_results, max_num_requests=args.num_infer_requests,
caught_exceptions=exceptions),
Modes.MIN_LATENCY:
HPE(ie, args.model, target_size=args.tsize, device=args.device.split(':')[-1].split(',')[0],
plugin_config=config_min_latency, results=completed_request_results, max_num_requests=1,
caught_exceptions=exceptions)
Copy link
Contributor

Choose a reason for hiding this comment

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

@Wovchena do we need two modes here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

No, but @druzhkov-paul was pointed at your version when it had this. That means to me it's our responsibility now to rewrite it later (that same is about -at, --architecture_type and other things).

Pavel Druzhkov and others added 3 commits November 23, 2020 14:43
Co-authored-by: Eduard Zamaliev <eduard.zamaliev@intel.com>
@IRDonch
Copy link

IRDonch commented Nov 25, 2020

@eizamaliev Ping?

@vladimir-dudnik vladimir-dudnik merged commit d6b6e3c into openvinotoolkit:develop Nov 26, 2020
@druzhkov-paul druzhkov-paul deleted the dp/hpe_update branch November 27, 2020 08:59
@druzhkov-paul
Copy link
Contributor Author

@Daniil-Osokin FYI

@Daniil-Osokin
Copy link
Contributor

@druzhkov-paul Sorry for the delay, it took awhile. Many thanks for making and sharing optimized post-processing! It really works faster in times, looks like you are vectorization jedi 😎 🤠 🦾. Very nice demo overall. And many thanks for the team (@eaidova @eizamaliev @IRDonch @vladimir-dudnik @Wovchena) for maintaining this awesome zoo 👍!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
demo Issues with demo results, performance and etc. model All about model, from enabling to issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants