Skip to content

Commit

Permalink
[Doc] fix api reference (#1792)
Browse files Browse the repository at this point in the history
  • Loading branch information
ly015 authored and Ben-Louis committed Feb 13, 2023
1 parent 0b7abbc commit 35f71d0
Show file tree
Hide file tree
Showing 18 changed files with 418 additions and 1,195 deletions.
6 changes: 3 additions & 3 deletions demo/docs/webcam_demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ Detailed configurations can be found in the config file.
In this demo we use two [top-down](https://github.com/open-mmlab/mmpose/tree/1.x/configs/body_2d_keypoint/topdown_heatmap) pose estimation models for humans and animals respectively. Users can choose models from the [MMPose Model Zoo](https://mmpose.readthedocs.io/en/1.x/modelzoo.html). To apply different pose models on different instance types, you can add multiple pose estimator nodes with `cls_names` set accordingly.

```python
# 'TopDownPoseEstimatorNode':
# 'TopdownPoseEstimatorNode':
# This node performs keypoint detection from the frame image using an
# MMPose top-down model. Detection results is needed.
dict(
type='TopDownPoseEstimatorNode',
type='TopdownPoseEstimatorNode',
name='human pose estimator',
model_config='configs/wholebody_2d_keypoint/'
'topdown_heatmap/coco-wholebody/'
Expand All @@ -82,7 +82,7 @@ Detailed configurations can be found in the config file.
input_buffer='det_result',
output_buffer='human_pose'),
dict(
type='TopDownPoseEstimatorNode',
type='TopdownPoseEstimatorNode',
name='animal pose estimator',
model_config='configs/animal_2d_keypoint/topdown_heatmap/'
'animalpose/td-hm_hrnet-w32_8xb64-210e_animalpose-256x256.py',
Expand Down
6 changes: 3 additions & 3 deletions demo/webcam_cfg/pose_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
'scratch_600e_coco_20210629_110627-974d9307.pth',
input_buffer='_input_', # `_input_` is an executor-reserved buffer
output_buffer='det_result'),
# 'TopDownPoseEstimatorNode':
# 'TopdownPoseEstimatorNode':
# This node performs keypoint detection from the frame image using an
# MMPose top-down model. Detection results is needed.
dict(
type='TopDownPoseEstimatorNode',
type='TopdownPoseEstimatorNode',
name='human pose estimator',
model_config='configs/wholebody_2d_keypoint/'
'topdown_heatmap/coco-wholebody/'
Expand All @@ -43,7 +43,7 @@
input_buffer='det_result',
output_buffer='human_pose'),
dict(
type='TopDownPoseEstimatorNode',
type='TopdownPoseEstimatorNode',
name='animal pose estimator',
model_config='configs/animal_2d_keypoint/topdown_heatmap/'
'animalpose/td-hm_hrnet-w32_8xb64-210e_animalpose-256x256.py',
Expand Down
4 changes: 4 additions & 0 deletions docs/en/_static/css/readthedocs.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@
height: 50px;
width: 120px;
}

table.autosummary td {
width: 35%
}
22 changes: 15 additions & 7 deletions docs/en/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ mmpose.apis
.. automodule:: mmpose.apis
:members:


mmpose.codecs
-------------

.. automodule:: mmpose.codecs
:members:


mmpose.models
---------------
backbones
Expand Down Expand Up @@ -113,16 +110,27 @@ mmpose.registry
:members:

mmpose.evaluation
---------------
.. automodule:: mmpose.evaluation
-----------------
metrics
^^^^^^^^^^^
.. automodule:: mmpose.evaluation.metrics
:members:

functional
^^^^^^^^^^^
.. automodule:: mmpose.evaluation.functional
:members:

mmpose.visualization
---------------
--------------------
.. automodule:: mmpose.visualization
:members:

mmpose.engine
---------------
.. automodule:: mmpose.engine
hooks
^^^^^^^^^^^
.. automodule:: mmpose.engine.hooks
:members:

.. include:: webcam_api.rst
3 changes: 2 additions & 1 deletion docs/en/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ def get_version():
# ones.
extensions = [
'sphinx.ext.autodoc', 'sphinx.ext.napoleon', 'sphinx.ext.viewcode',
'sphinx_markdown_tables', 'sphinx_copybutton', 'myst_parser'
'sphinx_markdown_tables', 'sphinx_copybutton', 'myst_parser',
'sphinx.ext.autosummary'
]

autodoc_mock_imports = ['json_tricks', 'mmpose.version']
Expand Down
1 change: 0 additions & 1 deletion docs/en/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ You can change the documentation language at the lower-left corner of the page.
notes/faq.md

.. toctree::
:maxdepth: 1
:caption: API Reference

api.rst
Expand Down
112 changes: 112 additions & 0 deletions docs/en/webcam_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
mmpose.apis.webcam
--------------------
.. contents:: MMPose Webcam API: Tools to build simple interactive webcam applications and demos
:depth: 2
:local:
:backlinks: top

Executor
^^^^^^^^^^^^^^^^^^^^
.. currentmodule:: mmpose.apis.webcam
.. autosummary::
:toctree: generated
:nosignatures:

WebcamExecutor

Nodes
^^^^^^^^^^^^^^^^^^^^
.. currentmodule:: mmpose.apis.webcam.nodes

Base Nodes
""""""""""""""""""""
.. autosummary::
:toctree: generated
:nosignatures:
:template: webcam_node_class.rst

Node
BaseVisualizerNode

Model Nodes
""""""""""""""""""""
.. autosummary::
:toctree: generated
:nosignatures:
:template: webcam_node_class.rst

DetectorNode
TopdownPoseEstimatorNode

Visualizer Nodes
""""""""""""""""""""
.. autosummary::
:toctree: generated
:nosignatures:
:template: webcam_node_class.rst

ObjectVisualizerNode
NoticeBoardNode
SunglassesEffectNode
BigeyeEffectNode

Helper Nodes
""""""""""""""""""""
.. autosummary::
:toctree: generated
:nosignatures:
:template: webcam_node_class.rst

ObjectAssignerNode
MonitorNode
RecorderNode

Utils
^^^^^^^^^^^^^^^^^^^^
.. currentmodule:: mmpose.apis.webcam.utils

Buffer and Message
""""""""""""""""""""
.. autosummary::
:toctree: generated
:nosignatures:

BufferManager
Message
FrameMessage
VideoEndingMessage

Pose
""""""""""""""""""""
.. autosummary::
:toctree: generated
:nosignatures:

get_eye_keypoint_ids
get_face_keypoint_ids
get_hand_keypoint_ids
get_mouth_keypoint_ids
get_wrist_keypoint_ids

Event
""""""""""""""""""""
.. autosummary::
:toctree: generated
:nosignatures:

EventManager

Misc
""""""""""""""""""""
.. autosummary::
:toctree: generated
:nosignatures:

copy_and_paste
screen_matting
expand_and_clamp
limit_max_fps
is_image_file
get_cached_file_path
load_image_from_disk_or_url
get_config_path
4 changes: 4 additions & 0 deletions docs/zh_cn/_static/css/readthedocs.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@
height: 50px;
width: 120px;
}

table.autosummary td {
width: 35%
}
22 changes: 15 additions & 7 deletions docs/zh_cn/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@ mmpose.apis
.. automodule:: mmpose.apis
:members:


mmpose.codecs
-------------

.. automodule:: mmpose.codecs
:members:


mmpose.models
---------------
backbones
Expand Down Expand Up @@ -113,16 +110,27 @@ mmpose.registry
:members:

mmpose.evaluation
---------------
.. automodule:: mmpose.evaluation
-----------------
metrics
^^^^^^^^^^^
.. automodule:: mmpose.evaluation.metrics
:members:

functional
^^^^^^^^^^^
.. automodule:: mmpose.evaluation.functional
:members:

mmpose.visualization
---------------
--------------------
.. automodule:: mmpose.visualization
:members:

mmpose.engine
---------------
.. automodule:: mmpose.engine
hooks
^^^^^^^^^^^
.. automodule:: mmpose.engine.hooks
:members:

.. include:: webcam_api.rst
3 changes: 2 additions & 1 deletion docs/zh_cn/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ def get_version():
# ones.
extensions = [
'sphinx.ext.autodoc', 'sphinx.ext.napoleon', 'sphinx.ext.viewcode',
'sphinx_markdown_tables', 'sphinx_copybutton', 'myst_parser'
'sphinx_markdown_tables', 'sphinx_copybutton', 'myst_parser',
'sphinx.ext.autosummary'
]

autodoc_mock_imports = ['json_tricks', 'mmpose.version']
Expand Down

0 comments on commit 35f71d0

Please sign in to comment.