Skip to content

Commit c6de39c

Browse files
authored
[Doc] fix api reference (#1792)
1 parent 2489991 commit c6de39c

File tree

20 files changed

+440
-1217
lines changed

20 files changed

+440
-1217
lines changed

Diff for: .github/workflows/merge_stage_test.yml

+11-11
Original file line numberDiff line numberDiff line change
@@ -180,24 +180,24 @@ jobs:
180180
with:
181181
python-version: ${{ matrix.python-version }}
182182
- name: Upgrade pip
183-
run: pip install pip --upgrade
183+
run: python -m pip install pip --upgrade
184184
- name: Install lmdb
185-
run: pip install lmdb
185+
run: python -m pip install lmdb
186186
- name: Install PyTorch
187-
run: pip install torch==1.8.1+${{matrix.platform}} torchvision==0.9.1+${{matrix.platform}} -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html
187+
run: python -m pip install torch==1.8.1+${{matrix.platform}} torchvision==0.9.1+${{matrix.platform}} -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html
188188
- name: Install mmpose dependencies
189189
run: |
190-
pip install -U numpy
191-
pip install git+https://github.com/open-mmlab/mmengine.git@main
192-
pip install -U openmim
190+
python -m pip install -U numpy
191+
python -m pip install git+https://github.com/open-mmlab/mmengine.git@main
192+
python -m pip install -U openmim
193193
mim install 'mmcv >= 2.0.0rc1'
194-
pip install git+https://github.com/open-mmlab/[email protected]
195-
pip install -r requirements/tests.txt
196-
pip install -r requirements/albu.txt
197-
pip install -r requirements/poseval.txt
194+
python -m pip install git+https://github.com/open-mmlab/[email protected]
195+
python -m pip install -r requirements/tests.txt
196+
python -m pip install -r requirements/albu.txt
197+
python -m pip install -r requirements/poseval.txt
198198
- name: Build and install
199199
run: |
200-
pip install -e .
200+
python -m pip install -e .
201201
- name: Run unittests and generate coverage report
202202
run: |
203203
pytest tests/

Diff for: .github/workflows/pr_stage_test.yml

+11-11
Original file line numberDiff line numberDiff line change
@@ -120,24 +120,24 @@ jobs:
120120
with:
121121
python-version: ${{ matrix.python-version }}
122122
- name: Upgrade pip
123-
run: pip install pip --upgrade
123+
run: python -m pip install pip --upgrade
124124
- name: Install lmdb
125-
run: pip install lmdb
125+
run: python -m pip install lmdb
126126
- name: Install PyTorch
127-
run: pip install torch==1.8.1+${{matrix.platform}} torchvision==0.9.1+${{matrix.platform}} -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html
127+
run: python -m pip install torch==1.8.1+${{matrix.platform}} torchvision==0.9.1+${{matrix.platform}} -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html
128128
- name: Install mmpose dependencies
129129
run: |
130-
pip install -U numpy
131-
pip install git+https://github.com/open-mmlab/mmengine.git@main
132-
pip install -U openmim
130+
python -m pip install -U numpy
131+
python -m pip install git+https://github.com/open-mmlab/mmengine.git@main
132+
python -m pip install -U openmim
133133
mim install 'mmcv >= 2.0.0rc1'
134-
pip install git+https://github.com/open-mmlab/[email protected]
135-
pip install -r requirements/tests.txt
136-
pip install -r requirements/albu.txt
137-
pip install -r requirements/poseval.txt
134+
python -m pip install git+https://github.com/open-mmlab/[email protected]
135+
python -m pip install -r requirements/tests.txt
136+
python -m pip install -r requirements/albu.txt
137+
python -m pip install -r requirements/poseval.txt
138138
- name: Build and install
139139
run: |
140-
pip install -e .
140+
python -m pip install -e .
141141
- name: Run unittests and generate coverage report
142142
run: |
143143
pytest tests/

Diff for: demo/docs/webcam_demo.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ Detailed configurations can be found in the config file.
6666
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.
6767

6868
```python
69-
# 'TopDownPoseEstimatorNode':
69+
# 'TopdownPoseEstimatorNode':
7070
# This node performs keypoint detection from the frame image using an
7171
# MMPose top-down model. Detection results is needed.
7272
dict(
73-
type='TopDownPoseEstimatorNode',
73+
type='TopdownPoseEstimatorNode',
7474
name='human pose estimator',
7575
model_config='configs/wholebody_2d_keypoint/'
7676
'topdown_heatmap/coco-wholebody/'
@@ -82,7 +82,7 @@ Detailed configurations can be found in the config file.
8282
input_buffer='det_result',
8383
output_buffer='human_pose'),
8484
dict(
85-
type='TopDownPoseEstimatorNode',
85+
type='TopdownPoseEstimatorNode',
8686
name='animal pose estimator',
8787
model_config='configs/animal_2d_keypoint/topdown_heatmap/'
8888
'animalpose/td-hm_hrnet-w32_8xb64-210e_animalpose-256x256.py',

Diff for: demo/webcam_cfg/pose_estimation.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
'scratch_600e_coco_20210629_110627-974d9307.pth',
2828
input_buffer='_input_', # `_input_` is an executor-reserved buffer
2929
output_buffer='det_result'),
30-
# 'TopDownPoseEstimatorNode':
30+
# 'TopdownPoseEstimatorNode':
3131
# This node performs keypoint detection from the frame image using an
3232
# MMPose top-down model. Detection results is needed.
3333
dict(
34-
type='TopDownPoseEstimatorNode',
34+
type='TopdownPoseEstimatorNode',
3535
name='human pose estimator',
3636
model_config='configs/wholebody_2d_keypoint/'
3737
'topdown_heatmap/coco-wholebody/'
@@ -43,7 +43,7 @@
4343
input_buffer='det_result',
4444
output_buffer='human_pose'),
4545
dict(
46-
type='TopDownPoseEstimatorNode',
46+
type='TopdownPoseEstimatorNode',
4747
name='animal pose estimator',
4848
model_config='configs/animal_2d_keypoint/topdown_heatmap/'
4949
'animalpose/td-hm_hrnet-w32_8xb64-210e_animalpose-256x256.py',

Diff for: docs/en/_static/css/readthedocs.css

+4
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@
44
height: 50px;
55
width: 120px;
66
}
7+
8+
table.autosummary td {
9+
width: 35%
10+
}

Diff for: docs/en/api.rst

+15-7
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@ mmpose.apis
33
.. automodule:: mmpose.apis
44
:members:
55

6-
76
mmpose.codecs
87
-------------
9-
108
.. automodule:: mmpose.codecs
119
:members:
1210

13-
1411
mmpose.models
1512
---------------
1613
backbones
@@ -113,16 +110,27 @@ mmpose.registry
113110
:members:
114111

115112
mmpose.evaluation
116-
---------------
117-
.. automodule:: mmpose.evaluation
113+
-----------------
114+
metrics
115+
^^^^^^^^^^^
116+
.. automodule:: mmpose.evaluation.metrics
117+
:members:
118+
119+
functional
120+
^^^^^^^^^^^
121+
.. automodule:: mmpose.evaluation.functional
118122
:members:
119123

120124
mmpose.visualization
121-
---------------
125+
--------------------
122126
.. automodule:: mmpose.visualization
123127
:members:
124128

125129
mmpose.engine
126130
---------------
127-
.. automodule:: mmpose.engine
131+
hooks
132+
^^^^^^^^^^^
133+
.. automodule:: mmpose.engine.hooks
128134
:members:
135+
136+
.. include:: webcam_api.rst

Diff for: docs/en/conf.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ def get_version():
4444
# ones.
4545
extensions = [
4646
'sphinx.ext.autodoc', 'sphinx.ext.napoleon', 'sphinx.ext.viewcode',
47-
'sphinx_markdown_tables', 'sphinx_copybutton', 'myst_parser'
47+
'sphinx_markdown_tables', 'sphinx_copybutton', 'myst_parser',
48+
'sphinx.ext.autosummary'
4849
]
4950

5051
autodoc_mock_imports = ['json_tricks', 'mmpose.version']

Diff for: docs/en/index.rst

-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ You can change the documentation language at the lower-left corner of the page.
8282
notes/faq.md
8383

8484
.. toctree::
85-
:maxdepth: 1
8685
:caption: API Reference
8786

8887
api.rst

Diff for: docs/en/webcam_api.rst

+112
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
mmpose.apis.webcam
2+
--------------------
3+
.. contents:: MMPose Webcam API: Tools to build simple interactive webcam applications and demos
4+
:depth: 2
5+
:local:
6+
:backlinks: top
7+
8+
Executor
9+
^^^^^^^^^^^^^^^^^^^^
10+
.. currentmodule:: mmpose.apis.webcam
11+
.. autosummary::
12+
:toctree: generated
13+
:nosignatures:
14+
15+
WebcamExecutor
16+
17+
Nodes
18+
^^^^^^^^^^^^^^^^^^^^
19+
.. currentmodule:: mmpose.apis.webcam.nodes
20+
21+
Base Nodes
22+
""""""""""""""""""""
23+
.. autosummary::
24+
:toctree: generated
25+
:nosignatures:
26+
:template: webcam_node_class.rst
27+
28+
Node
29+
BaseVisualizerNode
30+
31+
Model Nodes
32+
""""""""""""""""""""
33+
.. autosummary::
34+
:toctree: generated
35+
:nosignatures:
36+
:template: webcam_node_class.rst
37+
38+
DetectorNode
39+
TopdownPoseEstimatorNode
40+
41+
Visualizer Nodes
42+
""""""""""""""""""""
43+
.. autosummary::
44+
:toctree: generated
45+
:nosignatures:
46+
:template: webcam_node_class.rst
47+
48+
ObjectVisualizerNode
49+
NoticeBoardNode
50+
SunglassesEffectNode
51+
BigeyeEffectNode
52+
53+
Helper Nodes
54+
""""""""""""""""""""
55+
.. autosummary::
56+
:toctree: generated
57+
:nosignatures:
58+
:template: webcam_node_class.rst
59+
60+
ObjectAssignerNode
61+
MonitorNode
62+
RecorderNode
63+
64+
Utils
65+
^^^^^^^^^^^^^^^^^^^^
66+
.. currentmodule:: mmpose.apis.webcam.utils
67+
68+
Buffer and Message
69+
""""""""""""""""""""
70+
.. autosummary::
71+
:toctree: generated
72+
:nosignatures:
73+
74+
BufferManager
75+
Message
76+
FrameMessage
77+
VideoEndingMessage
78+
79+
Pose
80+
""""""""""""""""""""
81+
.. autosummary::
82+
:toctree: generated
83+
:nosignatures:
84+
85+
get_eye_keypoint_ids
86+
get_face_keypoint_ids
87+
get_hand_keypoint_ids
88+
get_mouth_keypoint_ids
89+
get_wrist_keypoint_ids
90+
91+
Event
92+
""""""""""""""""""""
93+
.. autosummary::
94+
:toctree: generated
95+
:nosignatures:
96+
97+
EventManager
98+
99+
Misc
100+
""""""""""""""""""""
101+
.. autosummary::
102+
:toctree: generated
103+
:nosignatures:
104+
105+
copy_and_paste
106+
screen_matting
107+
expand_and_clamp
108+
limit_max_fps
109+
is_image_file
110+
get_cached_file_path
111+
load_image_from_disk_or_url
112+
get_config_path

Diff for: docs/zh_cn/_static/css/readthedocs.css

+4
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@
44
height: 50px;
55
width: 120px;
66
}
7+
8+
table.autosummary td {
9+
width: 35%
10+
}

Diff for: docs/zh_cn/api.rst

+15-7
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@ mmpose.apis
33
.. automodule:: mmpose.apis
44
:members:
55

6-
76
mmpose.codecs
87
-------------
9-
108
.. automodule:: mmpose.codecs
119
:members:
1210

13-
1411
mmpose.models
1512
---------------
1613
backbones
@@ -113,16 +110,27 @@ mmpose.registry
113110
:members:
114111

115112
mmpose.evaluation
116-
---------------
117-
.. automodule:: mmpose.evaluation
113+
-----------------
114+
metrics
115+
^^^^^^^^^^^
116+
.. automodule:: mmpose.evaluation.metrics
117+
:members:
118+
119+
functional
120+
^^^^^^^^^^^
121+
.. automodule:: mmpose.evaluation.functional
118122
:members:
119123

120124
mmpose.visualization
121-
---------------
125+
--------------------
122126
.. automodule:: mmpose.visualization
123127
:members:
124128

125129
mmpose.engine
126130
---------------
127-
.. automodule:: mmpose.engine
131+
hooks
132+
^^^^^^^^^^^
133+
.. automodule:: mmpose.engine.hooks
128134
:members:
135+
136+
.. include:: webcam_api.rst

Diff for: docs/zh_cn/conf.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ def get_version():
4444
# ones.
4545
extensions = [
4646
'sphinx.ext.autodoc', 'sphinx.ext.napoleon', 'sphinx.ext.viewcode',
47-
'sphinx_markdown_tables', 'sphinx_copybutton', 'myst_parser'
47+
'sphinx_markdown_tables', 'sphinx_copybutton', 'myst_parser',
48+
'sphinx.ext.autosummary'
4849
]
4950

5051
autodoc_mock_imports = ['json_tricks', 'mmpose.version']

0 commit comments

Comments
 (0)