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

[Feature] Gesture recognition algorithm MTUT on NVGesture dataset #1380

Merged
merged 101 commits into from
Jun 2, 2022

Conversation

Ben-Louis
Copy link
Collaborator

Motivation

Add hand gesture recognition function to mmpose.

Modification

  • add NVGesture dataset
  • add I3D backbone to extract features from videos
  • add MTUT head
  • add GestureRecognizer to support general gesture recognition algorithms
  • add configs for training/test of I3D+MTUT model on NVGesture dataset

BC-breaking (Optional)

Use cases (Optional)

Checklist

Before PR:

  • I have read and followed the workflow indicated in the CONTRIBUTING.md to create this PR.
  • Pre-commit or linting tools indicated in CONTRIBUTING.md are used to fix the potential lint issues.
  • Bug fixes are covered by unit tests, the case that causes the bug should be added in the unit tests.
  • New functionalities are covered by complete unit tests. If not, please add more unit tests to ensure correctness.
  • The documentation has been modified accordingly, including docstring or example tutorials.

After PR:

  • CLA has been signed and all committers have signed the CLA in this PR.

@codecov
Copy link

codecov bot commented May 18, 2022

Codecov Report

Merging #1380 (d698319) into master (a47e54e) will increase coverage by 1.14%.
The diff coverage is 84.15%.

@@            Coverage Diff             @@
##           master    #1380      +/-   ##
==========================================
+ Coverage   83.21%   84.35%   +1.14%     
==========================================
  Files         225      232       +7     
  Lines       19006    19308     +302     
  Branches     3395     3472      +77     
==========================================
+ Hits        15815    16287     +472     
+ Misses       2359     2154     -205     
- Partials      832      867      +35     
Flag Coverage Δ
unittests 84.29% <84.15%> (+1.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmpose/apis/__init__.py 100.00% <ø> (ø)
mmpose/apis/inference_tracking.py 61.41% <0.00%> (ø)
mmpose/datasets/__init__.py 100.00% <ø> (ø)
mmpose/datasets/pipelines/loading.py 74.11% <59.45%> (-11.30%) ⬇️
mmpose/core/utils/model_util_hooks.py 71.42% <71.42%> (ø)
mmpose/models/detectors/gesture_recognizer.py 72.83% <72.83%> (ø)
mmpose/apis/inference.py 59.88% <77.77%> (+2.12%) ⬆️
.../datasets/datasets/gesture/gesture_base_dataset.py 80.48% <80.48%> (ø)
mmpose/datasets/pipelines/gesture_transform.py 83.63% <83.63%> (ø)
...ose/datasets/datasets/gesture/nvgesture_dataset.py 87.35% <87.35%> (ø)
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a47e54e...d698319. Read the comment docs.

@CLAassistant
Copy link

CLAassistant commented May 26, 2022

CLA assistant check
All committers have signed the CLA.

@jin-s13 jin-s13 requested a review from ly015 May 26, 2022 07:11

model = dict(
type='GestureRecognizer',
modality=['rgb'],
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this config for rgb only?
Then the config file path gesture_sview_rgbd_vid is a little bit confusing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes. As stated in /configs/hand/gesture_sview_rgbd_vid/mtut/nvgesture/i3d_nvgesture.md, MTUT supports multi-modal training and uni-modal inference. This config is mainly used for demo and webcam with RGB videos.

dict: Evaluation results for evaluation metric.
"""
metrics = metric if isinstance(metric, list) else [metric]
allowed_metrics = ['AP']
Copy link
Collaborator

Choose a reason for hiding this comment

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

AP or mAP?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

AP. Is it less confusing if I change 'mAP' to 'AP_mean'?

Copy link
Collaborator

@jin-s13 jin-s13 left a comment

Choose a reason for hiding this comment

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

Looks good to me in general. Unittests are required before merging.

mmpose/models/backbones/utils/transformer.py Show resolved Hide resolved
mmpose/datasets/pipelines/gesture_transform.py Outdated Show resolved Hide resolved
mmpose/datasets/pipelines/gesture_transform.py Outdated Show resolved Hide resolved
mmpose/datasets/pipelines/gesture_transform.py Outdated Show resolved Hide resolved
@ly015
Copy link
Member

ly015 commented Jun 1, 2022

@Ben-Louis CI failed.

@Ben-Louis
Copy link
Collaborator Author

@Ben-Louis CI failed.

I see. Unittest fails because of incompatibility of isnan function in Pytorch 1.5. I use the method mentioned in yuantn/MI-AOD#2 to get rid of this function.

@ly015 ly015 removed the need tests label Jun 2, 2022
@ly015 ly015 merged commit d3c17d5 into open-mmlab:master Jun 2, 2022
@ly015 ly015 mentioned this pull request Jun 2, 2022
6 tasks
@Ben-Louis Ben-Louis deleted the gesture_recognition branch July 29, 2022 03:57
shuheilocale pushed a commit to shuheilocale/mmpose that referenced this pull request May 5, 2023
…en-mmlab#1380)

* add nvgesture dataset

* fix nvgesture pipelines

* update gesture datasets

* add ModelSetEpochHook

* nvgesture dataset support multi-GPU evalutation

* add i3d+mtut model

* add nvgesture i3d configs

* webcam add hand detector

* gesture recognition with bbox

* add hand detector config

* fix gesture recognizer init bug

* webcam/gesture - recognizer runs successfully

* delete unnecessary comment

* fix lint error in gesture configs

* add nvgesture category info

* webcam/gesture - display gesture recognition result

* add gesture recognition related docs

* update gesture related comments

* update light hand det model in demo doc

* update gesture recognition configs and results

* auto modify model-index.yml

* stabilize ssa loss in mtut

* add multi-input node comment

* synchronize tools/webcam with master

* add gesture task-name mapping

* move gesture configs to configs/hand/

* fix a bug in demo (open-mmlab#1373)

* update gesture datasets

* add ModelSetEpochHook

* nvgesture dataset support multi-GPU evalutation

* add i3d+mtut model

* add nvgesture i3d configs

* webcam add hand detector

* gesture recognition with bbox

* add hand detector config

* fix gesture recognizer init bug

* webcam/gesture - recognizer runs successfully

* delete unnecessary comment

* fix lint error in gesture configs

* add nvgesture category info

* webcam/gesture - display gesture recognition result

* add gesture recognition related docs

* update gesture related comments

* update light hand det model in demo doc

* update gesture recognition configs and results

* auto modify model-index.yml

* stabilize ssa loss in mtut

* add multi-input node comment

* synchronize tools/webcam with master

* add gesture task-name mapping

* move gesture configs to configs/hand/

* solve conflict in mmdet_modelzoo.md

* add gesture recogition into webcam

* hand gesture inference config explanation

* add gesture recognizer node in __init__.py

* add gesture webcam readme

* Adjust inference tracking min keypoints (open-mmlab#1398)

* Adjust inference tracking min keypoints

* Special case for min_keypoints <= 0 doesn't seem to be required

* remove unnecessary transformer utils (open-mmlab#1405)

* add nvgesture dataset

* fix nvgesture pipelines

* update gesture datasets

* add ModelSetEpochHook

* nvgesture dataset support multi-GPU evalutation

* add i3d+mtut model

* add nvgesture i3d configs

* webcam add hand detector

* gesture recognition with bbox

* add hand detector config

* fix gesture recognizer init bug

* webcam/gesture - recognizer runs successfully

* delete unnecessary comment

* fix lint error in gesture configs

* add nvgesture category info

* webcam/gesture - display gesture recognition result

* add gesture recognition related docs

* update gesture related comments

* update light hand det model in demo doc

* update gesture recognition configs and results

* auto modify model-index.yml

* stabilize ssa loss in mtut

* add multi-input node comment

* synchronize tools/webcam with master

* add gesture task-name mapping

* move gesture configs to configs/hand/

* fix grammer errors in docs

* fix a lint error in doc

* update nvgesture evaluation

* add introduction and assertion to TemporalPooling

* generalize NVGestureRandomFlip

* add unittests for gesture pipelines

* delete duplicated config

* add gesture inference unittest

* add gesture dataset unittest

* fix gesture inference unittest error

* add backbone I3D unittest

* add mtut head unittest

* fix mtut head unittest error

* add gesture recognizer unittest

Co-authored-by: Yining Li <liyining0712@gmail.com>
Co-authored-by: Philipp Allgeuer <5592992+pallgeuer@users.noreply.github.com>
ajgrafton pushed a commit to ajgrafton/mmpose that referenced this pull request Mar 6, 2024
…en-mmlab#1380)

* add nvgesture dataset

* fix nvgesture pipelines

* update gesture datasets

* add ModelSetEpochHook

* nvgesture dataset support multi-GPU evalutation

* add i3d+mtut model

* add nvgesture i3d configs

* webcam add hand detector

* gesture recognition with bbox

* add hand detector config

* fix gesture recognizer init bug

* webcam/gesture - recognizer runs successfully

* delete unnecessary comment

* fix lint error in gesture configs

* add nvgesture category info

* webcam/gesture - display gesture recognition result

* add gesture recognition related docs

* update gesture related comments

* update light hand det model in demo doc

* update gesture recognition configs and results

* auto modify model-index.yml

* stabilize ssa loss in mtut

* add multi-input node comment

* synchronize tools/webcam with master

* add gesture task-name mapping

* move gesture configs to configs/hand/

* fix a bug in demo (open-mmlab#1373)

* update gesture datasets

* add ModelSetEpochHook

* nvgesture dataset support multi-GPU evalutation

* add i3d+mtut model

* add nvgesture i3d configs

* webcam add hand detector

* gesture recognition with bbox

* add hand detector config

* fix gesture recognizer init bug

* webcam/gesture - recognizer runs successfully

* delete unnecessary comment

* fix lint error in gesture configs

* add nvgesture category info

* webcam/gesture - display gesture recognition result

* add gesture recognition related docs

* update gesture related comments

* update light hand det model in demo doc

* update gesture recognition configs and results

* auto modify model-index.yml

* stabilize ssa loss in mtut

* add multi-input node comment

* synchronize tools/webcam with master

* add gesture task-name mapping

* move gesture configs to configs/hand/

* solve conflict in mmdet_modelzoo.md

* add gesture recogition into webcam

* hand gesture inference config explanation

* add gesture recognizer node in __init__.py

* add gesture webcam readme

* Adjust inference tracking min keypoints (open-mmlab#1398)

* Adjust inference tracking min keypoints

* Special case for min_keypoints <= 0 doesn't seem to be required

* remove unnecessary transformer utils (open-mmlab#1405)

* add nvgesture dataset

* fix nvgesture pipelines

* update gesture datasets

* add ModelSetEpochHook

* nvgesture dataset support multi-GPU evalutation

* add i3d+mtut model

* add nvgesture i3d configs

* webcam add hand detector

* gesture recognition with bbox

* add hand detector config

* fix gesture recognizer init bug

* webcam/gesture - recognizer runs successfully

* delete unnecessary comment

* fix lint error in gesture configs

* add nvgesture category info

* webcam/gesture - display gesture recognition result

* add gesture recognition related docs

* update gesture related comments

* update light hand det model in demo doc

* update gesture recognition configs and results

* auto modify model-index.yml

* stabilize ssa loss in mtut

* add multi-input node comment

* synchronize tools/webcam with master

* add gesture task-name mapping

* move gesture configs to configs/hand/

* fix grammer errors in docs

* fix a lint error in doc

* update nvgesture evaluation

* add introduction and assertion to TemporalPooling

* generalize NVGestureRandomFlip

* add unittests for gesture pipelines

* delete duplicated config

* add gesture inference unittest

* add gesture dataset unittest

* fix gesture inference unittest error

* add backbone I3D unittest

* add mtut head unittest

* fix mtut head unittest error

* add gesture recognizer unittest

Co-authored-by: Yining Li <liyining0712@gmail.com>
Co-authored-by: Philipp Allgeuer <5592992+pallgeuer@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants