Skip to content

Commit

Permalink
[Docs] Refine API reference. (#774)
Browse files Browse the repository at this point in the history
* [Docs] Refine API reference

* Add PoolFormer
  • Loading branch information
mzr1996 authored Apr 15, 2022
1 parent 29b882d commit 702c196
Show file tree
Hide file tree
Showing 34 changed files with 840 additions and 132 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,12 @@ docs/en/_build/
docs/en/_model_zoo.rst
docs/en/modelzoo_statistics.md
docs/en/papers/
docs/en/api/generated/
docs/zh_CN/_build/
docs/zh_CN/_model_zoo.rst
docs/zh_CN/modelzoo_statistics.md
docs/zh_CN/papers/
docs/zh_CN/api/generated/

# PyBuilder
target/
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 @@ -14,3 +14,7 @@ article.pytorch-article .section :not(dt) > code {
background-color: #f3f4f7;
border-radius: 5px;
}

table.colwidths-auto td {
width: 50%
}
14 changes: 14 additions & 0 deletions docs/en/_templates/classtemplate.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. role:: hidden
:class: hidden-section
.. currentmodule:: {{ module }}


{{ name | underline}}

.. autoclass:: {{ name }}
:members:


..
autogenerated from source/_templates/classtemplate.rst
note it does not have :inherited-members:
68 changes: 0 additions & 68 deletions docs/en/api.rst

This file was deleted.

45 changes: 45 additions & 0 deletions docs/en/api/apis.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
.. role:: hidden
:class: hidden-section

mmcls.apis
===================================

These are some high-level APIs for classification tasks.

.. contents:: mmcls.apis
:depth: 2
:local:
:backlinks: top

.. currentmodule:: mmcls.apis

Train
------------------

.. autosummary::
:toctree: generated
:nosignatures:

init_random_seed
set_random_seed
train_model

Test
------------------
.. autosummary::
:toctree: generated
:nosignatures:

single_gpu_test
multi_gpu_test

Inference
------------------

.. autosummary::
:toctree: generated
:nosignatures:

init_model
inference_model
show_result_pyplot
61 changes: 61 additions & 0 deletions docs/en/api/core.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
.. role:: hidden
:class: hidden-section

mmcls.core
===================================

This package includes some runtime components. These components are useful in
classification tasks but not supported by MMCV yet.

.. note::

Some components may be moved to MMCV in the future.

.. contents:: mmcls.core
:depth: 2
:local:
:backlinks: top

.. currentmodule:: mmcls.core

Evaluation
------------------

Evaluation metrics calculation functions

.. autosummary::
:toctree: generated
:nosignatures:

precision
recall
f1_score
precision_recall_f1
average_precision
mAP
support
average_performance
calculate_confusion_matrix

Hook
------------------

.. autosummary::
:toctree: generated
:nosignatures:
:template: classtemplate.rst

ClassNumCheckHook
PreciseBNHook
CosineAnnealingCooldownLrUpdaterHook


Optimizers
------------------

.. autosummary::
:toctree: generated
:nosignatures:
:template: classtemplate.rst

Lamb
56 changes: 56 additions & 0 deletions docs/en/api/datasets.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
.. role:: hidden
:class: hidden-section

mmcls.datasets
===================================

The ``datasets`` package contains several usual datasets for image classification tasks and some dataset wrappers.

.. currentmodule:: mmcls.datasets

Custom Dataset
--------------

.. autoclass:: CustomDataset

ImageNet
--------

.. autoclass:: ImageNet

.. autoclass:: ImageNet21k

CIFAR
-----

.. autoclass:: CIFAR10

.. autoclass:: CIFAR100

MNIST
-----

.. autoclass:: MNIST

.. autoclass:: FashionMNIST

VOC
---

.. autoclass:: VOC

Base classes
------------

.. autoclass:: BaseDataset

.. autoclass:: MultiLabelDataset

Dataset Wrappers
----------------

.. autoclass:: ConcatDataset

.. autoclass:: RepeatDataset

.. autoclass:: ClassBalancedDataset
Loading

0 comments on commit 702c196

Please sign in to comment.