Commit b6e471d5 authored by Stanislav Pidhorskyi's avatar Stanislav Pidhorskyi Committed by Facebook GitHub Bot
Browse files

Sphinx docs

Summary: Added sphinx docs and github workflow to build gh-pages

Reviewed By: HapeMask

Differential Revision: D63498319

fbshipit-source-id: 401aabb6dc1624a26c2c9231ab2a1e6b98458190
parent 6ee72295
name: Doc Build
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build_docs_job:
runs-on: ubuntu-latest
# Grant write permission here so that the doc can be pushed to gh-pages branch
permissions:
contents: write
strategy:
matrix:
python-version: [3.10]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Dependencies
run: |
echo `python3 --version`
sudo apt-get install -y python-setuptools
sudo apt-get install -y python3-sphinx
sudo apt-get install -y pandoc
python3 -m pip install --upgrade pip
python3 -m pip install setuptools
python3 -m pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
id: build
- name: Build the docset
run: |
cd docs
pip install -r requirements.txt
make html
- name: Get output time
run: echo "The time was ${{ steps.build.outputs.time }}"
- name: Deploy
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: ./docs/build/html # The folder the action should deploy.
recursive-include src/ *.h *.cpp *.cu *.cuh
...@@ -50,18 +50,16 @@ img = bary * (index_img != -1) ...@@ -50,18 +50,16 @@ img = bary * (index_img != -1)
save_image(img, "render.png") save_image(img, "render.png")
``` ```
![hello triangle](doc/hellow_triangle.png) ![hello triangle](docs/source/_static/hellow_triangle.png)
## Dependencies ## Dependencies
* PyTorch >= 2.1.0 * PyTorch >= 2.1.0
## Building ## Installing
To build a wheel and install it: To build a wheel and install it:
``` ```
pip install wheel pip install git+https://github.com/facebookresearch/DRTK.git
python setup.py bdist_wheel
pip install dist/drtk-<wheel_name>.whl
``` ```
To build inplace, which is useful for package development: To build inplace, which is useful for package development:
......
SPHINXOPTS ?=
SPHINXAPIDOC ?= sphinx-apidoc
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
autodoc:
@$(SPHINXAPIDOC) -o "$(SOURCEDIR)" "../drtk" $(SPHINXOPTS) $(O)
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
sphinx
sphinx_markdown_builder
sphinx-panels
sphinxcontrib-katex
pydata_sphinx_theme
accessible-pygments
myst_parser
sphinx_design
nbsphinx
ipython
#rtd-footer-container {
margin-top: 0px !important;
margin-bottom: 0px !important;
}
.sig-name {
font-size: 1.0em;
color: var(--pst-color-inline-code);
}
article.bd-article .function dt.sig {
position: relative;
background: var(--sig_nkg);
padding: 0.8rem;
border-left: 3px solid #ee4c2c;
word-wrap: break-word;
padding-right: 100px;
font-weight: 400;
font-size: 0.9em;
font-family: IBMPlexMono,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New", monospace, var(--pst-font-family-monospace-system);
}
html[data-theme="dark"] {
--sig_nkg: #2b2b2b;
--pst-color-inline-code: #e16969;
--pst-color-surface: #2b2b2b;
}
html[data-theme="light"] {
--sig_nkg: #f2f2f2;
--pst-color-inline-code: #912525;
--pst-color-surface: #f2f2f2;
}
html {
--pst-color-inline-code: #912525;
--pst-font-size-icon: 2.0rem;
--bs-nav-link-font-size: 1.5rem;
--pst-color-surface: #f2f2f2;
}
a.headerlink {
font-size: 1.0em;
}
ul.bd-breadcrumbs {
font-size: 1.5rem;
li.breadcrumb-item {
&:not(.breadcrumb-home)::before {
font-size: 1.5rem;
}
}
}
.navbar-brand {
font-size: 2.5em;
}
.bd-main .bd-content .bd-article-container {
max-width: 80em;
}
.bd-page-width {
max-width: 96rem;
}
.bd-sidebar-primary {
width: 16rem;
}
p.bd-links__title {
visibility: collapse;
}
drtk.edge_grad_estimator
========================
.. automodule:: drtk.edge_grad_estimator
:no-index:
.. currentmodule:: drtk
.. autosummary::
:nosignatures:
edge_grad_estimator
edge_grad_estimator_ref
.. autofunction:: edge_grad_estimator
.. autofunction:: edge_grad_estimator_ref
.. currentmodule:: drtk.utils
Geometry utils
==============
.. automodule:: drtk.utils.geometry
.. autosummary::
:nosignatures:
face_info
vert_binormals
vert_normals
.. autofunction:: face_info
.. autofunction:: vert_binormals
.. autofunction:: vert_normals
drtk.grid_scatter
=================
.. automodule:: drtk.grid_scatter
:no-index:
.. currentmodule:: drtk
.. autosummary::
:nosignatures:
grid_scatter
grid_scatter_ref
.. autofunction:: grid_scatter
.. autofunction:: grid_scatter_ref
:github_url: https://github.com/facebookresearch/DRTK
DRTK API
===================================
DRTK is a PyTorch library that provides functionality for differentiable rasterization.
The package consists of five main modules:
* :doc:`transform`
* :doc:`rasterize`
* :doc:`render`
* :doc:`interpolate`
* :doc:`edge_grad_estimator`
.. toctree::
:glob:
:maxdepth: 3
:caption: Main API
transform
rasterize
render
interpolate
edge_grad_estimator
mipmap_grid_sample
grid_scatter
msi
.. toctree::
:glob:
:maxdepth: 3
:caption: Utils
projection
geometry
indexing
.. currentmodule:: drtk.utils
Indexing utils
==============
.. automodule:: drtk.utils.indexing
.. autosummary::
:nosignatures:
index
.. autofunction:: index
drtk.interpolate
================
.. automodule:: drtk.interpolate
:no-index:
.. currentmodule:: drtk
.. autosummary::
:nosignatures:
interpolate
interpolate_ref
.. autofunction:: interpolate
.. autofunction:: interpolate_ref
drtk.mipmap_grid_sample
=======================
.. automodule:: drtk.mipmap_grid_sample
:no-index:
.. currentmodule:: drtk
.. autosummary::
:nosignatures:
mipmap_grid_sample
mipmap_grid_sample_ref
.. autofunction:: mipmap_grid_sample
.. autofunction:: mipmap_grid_sample_ref
drtk.msi
========
.. automodule:: drtk.msi
:no-index:
.. currentmodule:: drtk
.. .. autosummary::
.. :nosignatures:
..
.. msi
.. autofunction:: msi
.. currentmodule:: drtk.utils
Projection functions
====================
.. automodule:: drtk.utils.projection
.. autosummary::
:nosignatures:
project_points
project_points_grad
.. autofunction:: project_points
.. autofunction:: project_points_grad
drtk.rasterize
==============
.. automodule:: drtk.rasterize
:no-index:
.. currentmodule:: drtk
.. autosummary::
:nosignatures:
rasterize
rasterize_with_depth
.. autofunction:: rasterize
.. autofunction:: rasterize_with_depth
drtk.render
============
.. automodule:: drtk.render
:no-index:
.. currentmodule:: drtk
.. autosummary::
:nosignatures:
render
render_ref
.. autofunction:: render
.. autofunction:: render_ref
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment