Skip to content

Commit

Permalink
Merge pull request #133 from yoshitomo-matsubara/dev
Browse files Browse the repository at this point in the history
Add a GitHub Action for deploying Sphinx documentation
  • Loading branch information
yoshitomo-matsubara authored Aug 14, 2023
2 parents 31efa30 + 0c692a5 commit 14922c0
Show file tree
Hide file tree
Showing 6 changed files with 306 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Deploy Sphinx Documentation
on: [push, pull_request, workflow_dispatch]
permissions:
contents: write
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Install dependencies
run: |
pip install sphinx sphinx_rtd_theme
- name: Install sc2bench
run: |
pip install -e .
- name: Sphinx build
run: |
sphinx-build -b html docs/source/ docs/_build/
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/
force_orphan: true
13 changes: 13 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
API
===


.. autosummary::
:toctree: generated
:recursive:

sc2bench.common
sc2bench.models
sc2bench.transforms
sc2bench.analysis
sc2bench.loss
82 changes: 82 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# 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 sys
import pathlib

sys.path.insert(0, pathlib.Path(__file__).parents[2].resolve().as_posix())


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

project = 'SC2 Benchmark'
copyright = '2023, Yoshitomo Matsubara'
author = 'Yoshitomo Matsubara'

# The full version, including alpha/beta/rc tags
version = 'v0.0.3'
release = 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.autosummary',
'sphinx.ext.doctest',
'sphinx.ext.viewcode',
'sphinx_rtd_theme'
]
autodoc_member_order = 'bysource'
highlight_language = 'python'

html_show_sourcelink = False
html_context = {
'display_github': True,
'github_user': 'yoshitomo-matsubara',
'github_repo': 'sc2-benchmark',
'github_version': 'main',
'conf_py_path': '/docs/source/'
}

import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'

html_theme_options = {
'display_version': True,
'style_external_links': True
}

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

# 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 = []


# -- 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 = 'sphinx_rtd_theme'

# 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']

46 changes: 46 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
.. SC2 Benchmark documentation master file, created by
sphinx-quickstart on Tue Jul 4 17:48:09 2023.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
SC2 Benchmark documentation
=========================================

SC2: Supervised Compression for Split Computing
***********************************************

.. image:: https://raw.githubusercontent.com/yoshitomo-matsubara/sc2-benchmark/main/imgs/input_vs_supervised_compression.png
:alt: Supervised Compression for Split Computing

Check out the :doc:`usage` section for further information.

.. toctree::
usage
package
api
:maxdepth: 3
:caption: Overview



Reference
*********
.. code-block:: bibtex
@article{matsubara2023sc2,
title={{SC2 Benchmark: Supervised Compression for Split Computing}},
author={Matsubara, Yoshitomo and Yang, Ruihan and Levorato, Marco and Mandt, Stephan},
journal={Transactions on Machine Learning Research},
issn={2835-8856},
year={2023},
url={https://openreview.net/forum?id=p28wv4G65d}
}
Indices and tables
******************

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
105 changes: 105 additions & 0 deletions docs/source/package.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
Package Documentation
=====


.. toctree::
:maxdepth: 3
:caption: Contents:

Check out the :doc:`api` section for quick reference.

sc2bench.common
------------

.. automodule:: sc2bench.common.config_util
:members:


sc2bench.models
------------

.. automodule:: sc2bench.models.backbone
:members:
:exclude-members: forward

.. automodule:: sc2bench.models.layer
:members:
:exclude-members: forward

.. automodule:: sc2bench.models.registry
:members:
:exclude-members: forward


.. automodule:: sc2bench.models.wrapper
:members:
:exclude-members: forward


sc2bench.models.detection
------------

.. automodule:: sc2bench.models.detection.base
:members:
:exclude-members: forward

.. automodule:: sc2bench.models.detection.rcnn
:members:
:exclude-members: forward

.. automodule:: sc2bench.models.detection.registry
:members:

.. automodule:: sc2bench.models.detection.transform
:members:
:exclude-members: forward

.. automodule:: sc2bench.models.detection.wrapper
:members:
:exclude-members: forward


sc2bench.models.segmentation
------------

.. automodule:: sc2bench.models.segmentation.base
:members:
:exclude-members: forward

.. automodule:: sc2bench.models.segmentation.deeplabv3
:members:
:exclude-members: forward

.. automodule:: sc2bench.models.segmentation.registry
:members:

.. automodule:: sc2bench.models.segmentation.wrapper
:members:
:exclude-members: forward


sc2bench.transforms
------------

.. automodule:: sc2bench.transforms.codec
:members:

.. automodule:: sc2bench.transforms.collator
:members:

.. automodule:: sc2bench.transforms.misc
:members:


sc2bench.analysis
------------

.. automodule:: sc2bench.analysis
:members:


sc2bench.loss
------------

.. automodule:: sc2bench.loss
:members:
30 changes: 30 additions & 0 deletions docs/source/usage.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Usage
=====


.. toctree::
:maxdepth: 3
:caption: Overview

Installation
------------

To use `sc2bench`, first install it using pip:

.. code-block:: console
$ pip install sc2bench
Examples
------------

`The official repository (https://github.com/yoshitomo-matsubara/sc2-benchmark) <https://github.com/yoshitomo-matsubara/sc2-benchmark>`_ offers many example scripts, configs,
and checkpoints of trained models in `sc2bench`.

Currently, `example scripts <https://github.com/yoshitomo-matsubara/sc2-benchmark/tree/main/script/task>`_
cover the following three tasks:

- Image classification (ILSVRC 2012)
- Object detection (COCO 2017)
- Semantic segmentation (PASCAL VOC 2012)

0 comments on commit 14922c0

Please sign in to comment.