Skip to content

Commit

Permalink
Add Sdk Doxygen document. (#2157)
Browse files Browse the repository at this point in the history
* doxygen c api

* fix ci

* update en doc

* update zh doc
  • Loading branch information
irexyc authored Jun 15, 2023
1 parent a8775d2 commit 264de4d
Show file tree
Hide file tree
Showing 39 changed files with 3,952 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,6 @@ csrc/mmdeploy/preprocess/elena/cuda_kernel/*

# c#
demo/csharp/*/Properties

# doxygen
docs/cppapi/docs
2,817 changes: 2,817 additions & 0 deletions docs/cppapi/Doxyfile

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions docs/en/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import subprocess
import sys

import pytorch_sphinx_theme
Expand Down Expand Up @@ -48,6 +49,7 @@
# ones.

extensions = [
'breathe',
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
Expand All @@ -58,6 +60,20 @@
'sphinxcontrib.mermaid'
] # yapf: disable

breathe_default_project = 'mmdeployapi'
breathe_projects = {'mmdeployapi': '../cppapi/docs/xml'}


def generate_doxygen_xml(app):
try:
folder = '../cppapi'
retcode = subprocess.call('cd %s; doxygen' % folder, shell=True)
if retcode < 0:
sys.stderr.write('doxygen terminated by signal %s' % (-retcode))
except Exception as e:
sys.stderr.write('doxygen execution failed: %s' % e)


autodoc_mock_imports = ['tensorrt']

autosectionlabel_prefix_document = True
Expand Down Expand Up @@ -211,6 +227,8 @@


def setup(app):
# Add hook for building doxygen xml when needed
app.connect('builder-inited', generate_doxygen_xml)
app.add_config_value('no_underscore_emphasis', False, 'env')
app.add_config_value('m2r_parse_relative_links', False, 'env')
app.add_config_value('m2r_anonymous_references', False, 'env')
Expand Down
6 changes: 6 additions & 0 deletions docs/en/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ You can switch between Chinese and English documents in the lower-left corner of
02-how-to-run/quantize_model.md
02-how-to-run/useful_tools.md

.. toctree::
:maxdepth: 1
:caption: SDK Usage

sdk_usage/index.rst

.. toctree::
:maxdepth: 1
:caption: Benchmark
Expand Down
30 changes: 30 additions & 0 deletions docs/en/sdk_usage/c/classifier.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
====================
classifier.h
====================

.. doxygenstruct:: mmdeploy_classification_t
:members:
:undoc-members:

.. doxygentypedef:: mmdeploy_classifier_t


.. doxygenfunction:: mmdeploy_classifier_create

.. doxygenfunction:: mmdeploy_classifier_create_by_path

.. doxygenfunction:: mmdeploy_classifier_apply

.. doxygenfunction:: mmdeploy_classifier_release_result

.. doxygenfunction:: mmdeploy_classifier_destroy

.. doxygenfunction:: mmdeploy_classifier_create_v2

.. doxygenfunction:: mmdeploy_classifier_create_input

.. doxygenfunction:: mmdeploy_classifier_apply_v2

.. doxygenfunction:: mmdeploy_classifier_apply_async

.. doxygenfunction:: mmdeploy_classifier_get_result
52 changes: 52 additions & 0 deletions docs/en/sdk_usage/c/common.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
====================
common.h
====================


.. doxygenenum:: mmdeploy_pixel_format_t

.. doxygenenum:: mmdeploy_data_type_t

.. doxygenenum:: mmdeploy_status_t

.. doxygentypedef:: mmdeploy_device_t

.. doxygentypedef:: mmdeploy_profiler_t

.. doxygenstruct:: mmdeploy_mat_t
:members:
:undoc-members:

.. doxygenstruct:: mmdeploy_rect_t
:members:
:undoc-members:

.. doxygenstruct:: mmdeploy_point_t
:members:
:undoc-members:

.. doxygentypedef:: mmdeploy_value_t

.. doxygentypedef:: mmdeploy_context_t

.. doxygenfunction:: mmdeploy_value_copy

.. doxygenfunction:: mmdeploy_value_destroy

.. doxygenfunction:: mmdeploy_device_create

.. doxygenfunction:: mmdeploy_device_destroy

.. doxygenfunction:: mmdeploy_profiler_create

.. doxygenfunction:: mmdeploy_profiler_destroy

.. doxygenfunction:: mmdeploy_context_create

.. doxygenfunction:: mmdeploy_context_create_by_device

.. doxygenfunction:: mmdeploy_context_destroy

.. doxygenfunction:: mmdeploy_context_add

.. doxygenfunction:: mmdeploy_common_create_input
33 changes: 33 additions & 0 deletions docs/en/sdk_usage/c/detector.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
====================
detector.h
====================

.. doxygenstruct:: mmdeploy_instance_mask_t
:members:
:undoc-members:

.. doxygenstruct:: mmdeploy_detection_t
:members:
:undoc-members:

.. doxygentypedef:: mmdeploy_detector_t

.. doxygenfunction:: mmdeploy_detector_create

.. doxygenfunction:: mmdeploy_detector_create_by_path

.. doxygenfunction:: mmdeploy_detector_apply

.. doxygenfunction:: mmdeploy_detector_release_result

.. doxygenfunction:: mmdeploy_detector_destroy

.. doxygenfunction:: mmdeploy_detector_create_v2

.. doxygenfunction:: mmdeploy_detector_create_input

.. doxygenfunction:: mmdeploy_detector_apply_v2

.. doxygenfunction:: mmdeploy_detector_apply_async

.. doxygenfunction:: mmdeploy_detector_get_result
59 changes: 59 additions & 0 deletions docs/en/sdk_usage/c/executor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
====================
executor.h
====================

.. doxygentypedef:: mmdeploy_then_fn_t

.. doxygentypedef:: mmdeploy_then_fn_v2_t

.. doxygentypedef:: mmdeploy_then_fn_v3_t

.. doxygentypedef:: mmdeploy_sender_t

.. doxygentypedef:: mmdeploy_scheduler_t

.. doxygentypedef:: mmdeploy_let_value_fn_t

.. doxygenfunction:: mmdeploy_executor_inline

.. doxygenfunction:: mmdeploy_executor_system_pool

.. doxygenfunction:: mmdeploy_executor_create_thread_pool

.. doxygenfunction:: mmdeploy_executor_create_thread

.. doxygenfunction:: mmdeploy_executor_dynamic_batch

.. doxygenfunction:: mmdeploy_scheduler_destroy

.. doxygenfunction:: mmdeploy_sender_copy

.. doxygenfunction:: mmdeploy_sender_destroy

.. doxygenfunction:: mmdeploy_executor_just

.. doxygenfunction:: mmdeploy_executor_schedule

.. doxygenfunction:: mmdeploy_executor_transfer_just

.. doxygenfunction:: mmdeploy_executor_transfer

.. doxygenfunction:: mmdeploy_executor_on

.. doxygenfunction:: mmdeploy_executor_then

.. doxygenfunction:: mmdeploy_executor_let_value

.. doxygenfunction:: mmdeploy_executor_split

.. doxygenfunction:: mmdeploy_executor_when_all

.. doxygenfunction:: mmdeploy_executor_ensure_started

.. doxygenfunction:: mmdeploy_executor_start_detached

.. doxygenfunction:: mmdeploy_executor_sync_wait

.. doxygenfunction:: mmdeploy_executor_sync_wait_v2

.. doxygenfunction:: mmdeploy_executor_execute
11 changes: 11 additions & 0 deletions docs/en/sdk_usage/c/model.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
====================
model.h
====================

.. doxygentypedef:: mmdeploy_model_t

.. doxygenfunction:: mmdeploy_model_create_by_path

.. doxygenfunction:: mmdeploy_model_create

.. doxygenfunction:: mmdeploy_model_destroy
16 changes: 16 additions & 0 deletions docs/en/sdk_usage/c/pipeline.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
====================
pipeline.h
====================


.. doxygentypedef:: mmdeploy_pipeline_t

.. doxygenfunction:: mmdeploy_pipeline_create_v3

.. doxygenfunction:: mmdeploy_pipeline_create_from_model

.. doxygenfunction:: mmdeploy_pipeline_apply

.. doxygenfunction:: mmdeploy_pipeline_apply_async

.. doxygenfunction:: mmdeploy_pipeline_destroy
31 changes: 31 additions & 0 deletions docs/en/sdk_usage/c/pose_detector.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
====================
pose_detector.h
====================

.. doxygenstruct:: mmdeploy_pose_detection_t
:members:
:undoc-members:

.. doxygentypedef:: mmdeploy_pose_detector_t

.. doxygenfunction:: mmdeploy_pose_detector_create

.. doxygenfunction:: mmdeploy_pose_detector_create_by_path

.. doxygenfunction:: mmdeploy_pose_detector_apply

.. doxygenfunction:: mmdeploy_pose_detector_apply_bbox

.. doxygenfunction:: mmdeploy_pose_detector_release_result

.. doxygenfunction:: mmdeploy_pose_detector_destroy

.. doxygenfunction:: mmdeploy_pose_detector_create_v2

.. doxygenfunction:: mmdeploy_pose_detector_create_input

.. doxygenfunction:: mmdeploy_pose_detector_apply_v2

.. doxygenfunction:: mmdeploy_pose_detector_apply_async

.. doxygenfunction:: mmdeploy_pose_detector_get_result
29 changes: 29 additions & 0 deletions docs/en/sdk_usage/c/pose_tracker.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
====================
pose_tracker.h
====================

.. doxygentypedef:: mmdeploy_pose_tracker_t

.. doxygentypedef:: mmdeploy_pose_tracker_state_t

.. doxygenstruct:: mmdeploy_pose_tracker_param_t
:members:
:undoc-members:

.. doxygenstruct:: mmdeploy_pose_tracker_target_t
:members:
:undoc-members:

.. doxygenfunction:: mmdeploy_pose_tracker_default_params

.. doxygenfunction:: mmdeploy_pose_tracker_create

.. doxygenfunction:: mmdeploy_pose_tracker_destroy

.. doxygenfunction:: mmdeploy_pose_tracker_create_state

.. doxygenfunction:: mmdeploy_pose_tracker_destroy_state

.. doxygenfunction:: mmdeploy_pose_tracker_apply

.. doxygenfunction:: mmdeploy_pose_tracker_release_result
29 changes: 29 additions & 0 deletions docs/en/sdk_usage/c/rotated_detector.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
====================
rotated_detector.h
====================

.. doxygenstruct:: mmdeploy_rotated_detection_t
:members:
:undoc-members:

.. doxygentypedef:: mmdeploy_rotated_detector_t

.. doxygenfunction:: mmdeploy_rotated_detector_create

.. doxygenfunction:: mmdeploy_rotated_detector_create_by_path

.. doxygenfunction:: mmdeploy_rotated_detector_apply

.. doxygenfunction:: mmdeploy_rotated_detector_release_result

.. doxygenfunction:: mmdeploy_rotated_detector_destroy

.. doxygenfunction:: mmdeploy_rotated_detector_create_v2

.. doxygenfunction:: mmdeploy_rotated_detector_create_input

.. doxygenfunction:: mmdeploy_rotated_detector_apply_v2

.. doxygenfunction:: mmdeploy_rotated_detector_apply_async

.. doxygenfunction:: mmdeploy_rotated_detector_get_result
29 changes: 29 additions & 0 deletions docs/en/sdk_usage/c/segmentor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
====================
segmentor.h
====================

.. doxygenstruct:: mmdeploy_segmentation_t
:members:
:undoc-members:

.. doxygentypedef:: mmdeploy_segmentor_t

.. doxygenfunction:: mmdeploy_segmentor_create

.. doxygenfunction:: mmdeploy_segmentor_create_by_path

.. doxygenfunction:: mmdeploy_segmentor_apply

.. doxygenfunction:: mmdeploy_segmentor_release_result

.. doxygenfunction:: mmdeploy_segmentor_destroy

.. doxygenfunction:: mmdeploy_segmentor_create_v2

.. doxygenfunction:: mmdeploy_segmentor_create_input

.. doxygenfunction:: mmdeploy_segmentor_apply_v2

.. doxygenfunction:: mmdeploy_segmentor_apply_async

.. doxygenfunction:: mmdeploy_segmentor_get_result
Loading

0 comments on commit 264de4d

Please sign in to comment.