Skip to content

Commit

Permalink
[Docs] Update REAME and setup Sphinx (#2)
Browse files Browse the repository at this point in the history
* add video in README

* add CITATION.cff

* add mmhuman3d link

* update video link

* add badge

* modify title size

* add sphinx generated docs

* add logo img in sphinx doc

* Update video link in README

* fix api.rst

* fix sphinx build documentation

* add additional license in index.rst

* replace source code links in docs with github url

* rm sphinx warn in cameras

* update docstring

* use github url in docs

* revise acc to mmpose conf.py

Co-authored-by: yanglei <[email protected]>
Co-authored-by: Maoxie <[email protected]>
  • Loading branch information
3 people authored Dec 2, 2021
1 parent 25492c5 commit f107203
Show file tree
Hide file tree
Showing 19 changed files with 619 additions and 130 deletions.
8 changes: 8 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- name: "MMHuman3D Contributors"
title: "MMHuman3D: OpenMMLab Human Pose and Shape Estimation Toolbox and Benchmark"
date-released: 2021-12-01
url: "https://github.com/open-mmlab/mmhuman3d"
license: Apache-2.0
25 changes: 17 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
<div align="center">
<img src="resources/mmhuman3d-logo.png" width="400"/>
<img src="resources/mmhuman3d-logo.png" width="600"/>
</div>

<!-- [![Documentation](https://readthedocs.org/projects/mmhuman3d/badge/?version=latest)](https://mmhuman3d.readthedocs.io/en/latest/?badge=latest)
[![actions](https://github.com/open-mmlab/mmhuman3d/workflows/build/badge.svg)](https://github.com/open-mmlab/mmhuman3d/actions)
[![codecov](https://codecov.io/gh/open-mmlab/mmhuman3d/branch/master/graph/badge.svg)](https://codecov.io/gh/open-mmlab/mmhuman3d)
[![PyPI](https://img.shields.io/pypi/v/mmhuman3d)](https://pypi.org/project/mmhuman3d/)
[![LICENSE](https://img.shields.io/github/license/open-mmlab/mmhuman3d.svg)](https://github.com/open-mmlab/mmhuman3d/blob/master/LICENSE)
[![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/open-mmlab/mmhuman3d.svg)](https://github.com/open-mmlab/mmhuman3d/issues)
[![Percentage of issues still open](https://isitmaintained.com/badge/open/open-mmlab/mmhuman3d.svg)](https://github.com/open-mmlab/mmhuman3d/issues) -->

[![LICENSE](https://img.shields.io/github/license/open-mmlab/mmhuman3d.svg)](https://github.com/open-mmlab/mmhuman3d/blob/master/LICENSE)

## Introduction

<!-- [![Documentation](https://readthedocs.org/projects/mmpose/badge/?version=latest)](https://mmpose.readthedocs.io/en/latest/?badge=latest)
[![actions](https://github.com/open-mmlab/mmpose/workflows/build/badge.svg)](https://github.com/open-mmlab/mmpose/actions)
[![codecov](https://codecov.io/gh/open-mmlab/mmpose/branch/master/graph/badge.svg)](https://codecov.io/gh/open-mmlab/mmpose)
[![PyPI](https://img.shields.io/pypi/v/mmpose)](https://pypi.org/project/mmpose/)
[![LICENSE](https://img.shields.io/github/license/open-mmlab/mmpose.svg)](https://github.com/open-mmlab/mmpose/blob/master/LICENSE)
[![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/open-mmlab/mmpose.svg)](https://github.com/open-mmlab/mmpose/issues)
[![Percentage of issues still open](https://isitmaintained.com/badge/open/open-mmlab/mmpose.svg)](https://github.com/open-mmlab/mmpose/issues) -->
MMHuman3D is an open source human pose and shape estimation toolbox based on PyTorch. It is a part of the [OpenMMLab](https://openmmlab.com/) project.

The main branch works with **PyTorch 1.7+**.

https://user-images.githubusercontent.com/62529255/144362861-e794b404-c48f-4ebe-b4de-b91c3fbbaa3b.mp4

### Major Features

Expand Down Expand Up @@ -120,3 +128,4 @@ We wish that the toolbox and benchmark could serve the growing research communit
- [MMGeneration](https://github.com/open-mmlab/mmgeneration): OpenMMLab next-generation toolbox for generative models.
- [MMFlow](https://github.com/open-mmlab/mmflow): OpenMMLab optical flow toolbox and benchmark.
- [MMFewShot](https://github.com/open-mmlab/mmfewshot): OpenMMLab FewShot Learning Toolbox and Benchmark.
- [MMHuman3D](https://github.com/open-mmlab/mmhuman3d): OpenMMLab Human Pose and Shape Estimation Toolbox and Benchmark.
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
6 changes: 6 additions & 0 deletions docs/_static/css/readthedocs.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.header-logo {
background-image: url("../image/mmhuman3d-logo.png");
background-size: 156px 40px;
height: 40px;
width: 156px;
}
Binary file added docs/_static/image/mmhuman3d-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
113 changes: 113 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
mmhuman3d.apis
----------------
.. automodule:: mmhuman3d.apis
:members:

mmhuman3d.core
----------------

cameras
^^^^^^^^^^
.. automodule:: mmhuman3d.core.cameras
:members:

conventions
^^^^^^^^^^^^^
.. automodule:: mmhuman3d.core.conventions
:members:

evaluation
^^^^^^^^^^
.. automodule:: mmhuman3d.core.evaluation
:members:

filter
^^^^^^^^^^
.. automodule:: mmhuman3d.core.filter
:members:

optimizer
^^^^^^^^^^
.. automodule:: mmhuman3d.core.optimizer
:members:

parametric_model
^^^^^^^^^^^^^^^^
.. automodule:: mmhuman3d.core.parametric_model
:members:

visualization
^^^^^^^^^^^^^
.. automodule:: mmhuman3d.core.visualization
:members:

mmhuman3d.models
----------------

models
^^^^^^
.. automodule:: mmhuman3d.models
:members:

architectures
^^^^^^^^^^^^^^
.. automodule:: mmhuman3d.models.architectures
:members:

backbones
^^^^^^^^^^
.. automodule:: mmhuman3d.models.backbones
:members:

discriminators
^^^^^^^^^^^^^^
.. automodule:: mmhuman3d.models.discriminators
:members:

necks
^^^^^^
.. automodule:: mmhuman3d.models.necks
:members:

heads
^^^^^^
.. automodule:: mmhuman3d.models.heads
:members:

losses
^^^^^^
.. automodule:: mmhuman3d.models.losses
:members:

utils
^^^^^^
.. automodule:: mmhuman3d.models.utils
:members:

mmhuman3d.data
-----------------

data
^^^^^^^^
.. automodule:: mmhuman3d.data
:members:

datasets
^^^^^^^^^
.. automodule:: mmhuman3d.data.datasets
:members:

data_converters
^^^^^^^^^^^^^^^
.. automodule:: mmhuman3d.data.data_converters
:members:

data_structures
^^^^^^^^^^^^^^^
.. automodule:: mmhuman3d.data.data_structures
:members:

mmhuman3d.utils
---------------
.. automodule:: mmhuman3d.utils
:members:
6 changes: 3 additions & 3 deletions docs/cameras.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ You can slice the cameras by index.

- **Define your new camera convention:**

If want to use a new convention, define your convention in [CAMERA_CONVENTION_FACTORY](mmhuman3d/core/conventions/cameras/__init__.py) by the order of right to, up to, and off screen. E.g., the first one is pyrender and its convention should be '+x+y+z'. '+' could be ignored. The second one is opencv and its convention should be '+x-y-z'. The third one is pytorch3d and its convention should be '-xyz'.
If want to use a new convention, define your convention in [CAMERA_CONVENTION_FACTORY](https://github.com/open-mmlab/mmhuman3d/tree/main/mmhuman3d/core/conventions/cameras/__init__.py) by the order of right to, up to, and off screen. E.g., the first one is pyrender and its convention should be '+x+y+z'. '+' could be ignored. The second one is opencv and its convention should be '+x-y-z'. The third one is pytorch3d and its convention should be '-xyz'.
```
opengl(pyrender) opencv pytorch3d
y z y
Expand Down Expand Up @@ -267,14 +267,14 @@ Convert functions are also defined in conventions.cameras.

- **Compute depth of points:**

You can simply convert points to the view coordinates and get the z value as depth. Example culd be found in [DepthRenderer](mmhuman3d/core/visualization/renderer/torch3d_renderer/depth_renderer.py).
You can simply convert points to the view coordinates and get the z value as depth. Example culd be found in [DepthRenderer](https://github.com/open-mmlab/mmhuman3d/tree/main/mmhuman3d/core/visualization/renderer/torch3d_renderer/depth_renderer.py).
```python
points_depth = cameras.compute_depth_of_points(points)
```

- **Compute normal of meshes:**

Use `pytorch3d` to compute normal of meshes. Example culd be found in [NormalRenderer](mmhuman3d/core/visualization/renderer/torch3d_renderer/normal_renderer.py).
Use `pytorch3d` to compute normal of meshes. Example culd be found in [NormalRenderer](https://github.com/open-mmlab/mmhuman3d/tree/main/mmhuman3d/core/visualization/renderer/torch3d_renderer/normal_renderer.py).
```python
normals = cameras.compute_normal_of_meshes(meshes)
```
Expand Down
178 changes: 178 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import subprocess
import sys

import pytorch_sphinx_theme

sys.path.insert(0, os.path.abspath('..'))

# -- Project information -----------------------------------------------------

project = 'MMHuman3D'
copyright = '2018-2021, OpenMMLab'
author = 'MMHuman3D Authors'
version_file = '../mmhuman3d/version.py'


def get_version():
with open(version_file, 'r') as f:
exec(compile(f.read(), version_file, 'exec'))
return locals()['__version__']


# The full version, including alpha/beta/rc tags
release = get_version()

# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
'sphinx_markdown_tables',
'sphinx_copybutton',
'myst_parser'
]

autodoc_mock_imports = [
'mmhuman3d.version', 'mmcv.ops'
]

# Ignore >>> when copying code
copybutton_prompt_text = r'>>> |\.\.\. '
copybutton_prompt_is_regexp = True

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
source_suffix = {
'.rst': 'restructuredtext',
'.md': 'markdown',
}

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'pytorch_sphinx_theme'
html_theme_path = [pytorch_sphinx_theme.get_html_theme_path()]

html_theme_options = {
'menu': [
{
'name': 'GitHub',
'url': 'https://github.com/open-mmlab/mmdetection'
},
{
'name':
'Projects',
'children': [
{
'name': 'MMAction2',
'url': 'https://github.com/open-mmlab/mmaction2',
},
{
'name': 'MMClassification',
'url': 'https://github.com/open-mmlab/mmclassification',
},
{
'name': 'MMDetection',
'url': 'https://github.com/open-mmlab/mmdetection',
},
{
'name': 'MMDetection3D',
'url': 'https://github.com/open-mmlab/mmdetection3d',
},
{
'name': 'MMEditing',
'url': 'https://github.com/open-mmlab/mmediting',
},
{
'name': 'MMGeneration',
'url': 'https://github.com/open-mmlab/mmgeneration',
},
{
'name': 'MMOCR',
'url': 'https://github.com/open-mmlab/mmocr',
},
{
'name': 'MMPose',
'url': 'https://github.com/open-mmlab/mmpose',
},
{
'name': 'MMSegmentation',
'url': 'https://github.com/open-mmlab/mmsegmentation',
},
{
'name': 'MMTracking',
'url': 'https://github.com/open-mmlab/mmtracking',
},
{
'name': 'MMFlow',
'url': 'https://github.com/open-mmlab/mmflow',
},
{
'name': 'MMHuman3D',
'url': 'https://github.com/open-mmlab/mmhuman3d',
},
]
},
{
'name':
'OpenMMLab',
'children': [
{
'name': 'Homepage',
'url': 'https://openmmlab.com/'
},
{
'name': 'GitHub',
'url': 'https://github.com/open-mmlab/'
},
{
'name': 'Twitter',
'url': 'https://twitter.com/OpenMMLab'
},
{
'name': 'Zhihu',
'url': 'https://zhihu.com/people/openmmlab'
},
]
},
]
}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_css_files = ['css/readthedocs.css']

# Enable ::: for my_st
myst_enable_extensions = ['colon_fence']

master_doc = 'index'
Loading

0 comments on commit f107203

Please sign in to comment.