Skip to content

Commit

Permalink
refactor docs page and tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarriba committed Jan 9, 2019
1 parent 991ff69 commit 39eb046
Show file tree
Hide file tree
Showing 14 changed files with 141 additions and 94 deletions.
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
sphinx==1.6.6
sphinx_rtd_theme==0.2.4
nbsphinx
15 changes: 8 additions & 7 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
'nbsphinx',
]

napoleon_use_ivar = True
Expand All @@ -36,15 +37,15 @@
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ['.rst', '.ipynb']

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = 'Torchgeometry'
copyright = '2018, Arraiy, Inc.'
author = 'Arraiy, Inc.'
project = u'PyTorch Geometry'
copyright = u'2018, Arraiy, Inc.'
author = u'Arraiy, Inc.'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand All @@ -67,7 +68,7 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = []
exclude_patterns = ['.ipynb_checkpoints']

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
Expand Down Expand Up @@ -112,7 +113,7 @@
# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'PyTorchdoc'
htmlhelp_basename = 'PyTorchGeometry'


# -- Options for LaTeX output ---------------------------------------------
Expand Down Expand Up @@ -140,7 +141,7 @@
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'pytorch.tex', 'torchgeometry Documentation',
'Torch Contributors', 'manual'),
'Arraiy', 'manual'),
]


Expand Down
26 changes: 26 additions & 0 deletions docs/source/conversions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Conversions
-----------

.. currentmodule:: torchgeometry

.. autofunction:: rad2deg
.. autofunction:: deg2rad
.. autofunction:: convert_points_from_homogeneous
.. autofunction:: convert_points_to_homogeneous
.. autofunction:: transform_points
.. autofunction:: angle_axis_to_rotation_matrix
.. autofunction:: rotation_matrix_to_angle_axis
.. autofunction:: rotation_matrix_to_quaternion
.. autofunction:: quaternion_to_angle_axis
.. autofunction:: rtvec_to_pose

.. autoclass:: RadToDeg
.. autoclass:: DegToRad
.. autoclass:: ConvertPointsFromHomogeneous
.. autoclass:: ConvertPointsToHomogeneous
.. autoclass:: TransformPoints
.. autoclass:: AngleAxisToRotationMatrix
.. autoclass:: RotationMatrixToAngleAxis
.. autoclass:: RotationMatrixToQuaternion
.. autoclass:: QuaternionToAngleAxis
.. autoclass:: RtvecToPose
File renamed without changes
File renamed without changes
11 changes: 11 additions & 0 deletions docs/source/geometric.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Geometric Image Transformations
-------------------------------

.. currentmodule:: torchgeometry

The functions in this section perform various geometrical transformations of 2D images.

.. autofunction:: warp_perspective
.. autofunction:: warp_affine
.. autofunction:: get_perspective_transform
.. autofunction:: get_rotation_matrix2d
6 changes: 6 additions & 0 deletions docs/source/image.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
torchgeometry.image
===================

.. currentmodule:: torchgeometry.image

.. autofunction:: get_gaussian_kernel
99 changes: 20 additions & 79 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,94 +9,35 @@ It consists of a set of routines and differentiable modules to solve generic geo

In this first version, we provide different functions designed mainly for computer vision applications, such as image and tensors warping modules which rely on the epipolar geometry theory. The roadmap will include adding more and more functionality so that developers in the short term can use the package for the purpose of optimizing their loss functions to solve geometry problems.

TGM v0.1.0 focuses on Image and tensor warping functions such as:
TGM focuses on Image and tensor warping functions such as:

* Calibration
* Epipolar geometry
* Homography
* Depth

.. toctree::
:maxdepth: 2
:caption: Package Reference

.. automodule:: torchgeometry
geometric
pinhole
conversions
warping
image
utils


Geometric Image Transformations
-------------------------------
.. toctree::
:maxdepth: 2
:caption: Tutorials

The functions in this section perform various geometrical transformations of 2D images.
warp_affine
warp_perspective

.. autofunction:: warp_perspective
.. autofunction:: warp_affine
.. autofunction:: get_perspective_transform
.. autofunction:: get_rotation_matrix2d
Indices and tables
==================


Pinhole
--------

.. note::
The pinhole model is represented in a single vector as follows:

.. math::
pinhole = (f_x, f_y, c_x, c_y, height, width, r_x, r_y, r_z, t_x, t_y, t_z)
where:
:math:`(r_x, r_y, r_z)` is the rotation vector in angle-axis convention.

:math:`(t_x, t_y, t_z)` is the translation vector.

.. autofunction:: inverse_pose
.. autofunction:: pinhole_matrix
.. autofunction:: inverse_pinhole_matrix
.. autofunction:: scale_pinhole
.. autofunction:: homography_i_H_ref

.. autoclass:: InversePose
.. autoclass:: PinholeMatrix
.. autoclass:: InversePinholeMatrix


Conversions
-----------

.. autofunction:: rad2deg
.. autofunction:: deg2rad
.. autofunction:: convert_points_from_homogeneous
.. autofunction:: convert_points_to_homogeneous
.. autofunction:: transform_points
.. autofunction:: angle_axis_to_rotation_matrix
.. autofunction:: rotation_matrix_to_angle_axis
.. autofunction:: rotation_matrix_to_quaternion
.. autofunction:: quaternion_to_angle_axis
.. autofunction:: rtvec_to_pose

.. autoclass:: RadToDeg
.. autoclass:: DegToRad
.. autoclass:: ConvertPointsFromHomogeneous
.. autoclass:: ConvertPointsToHomogeneous
.. autoclass:: TransformPoints
.. autoclass:: AngleAxisToRotationMatrix
.. autoclass:: RotationMatrixToAngleAxis
.. autoclass:: RotationMatrixToQuaternion
.. autoclass:: QuaternionToAngleAxis
.. autoclass:: RtvecToPose


Utilities
---------

.. autofunction:: tensor_to_image
.. autofunction:: image_to_tensor


Warping
-------

.. autoclass:: HomographyWarper
:members:

.. autoclass:: DepthWarper
:members:

.. autofunction:: homography_warp
.. autofunction:: depth_warp
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
25 changes: 25 additions & 0 deletions docs/source/pinhole.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Pinhole
--------

.. currentmodule:: torchgeometry

.. note::
The pinhole model is represented in a single vector as follows:

.. math::
pinhole = (f_x, f_y, c_x, c_y, height, width, r_x, r_y, r_z, t_x, t_y, t_z)
where:
:math:`(r_x, r_y, r_z)` is the rotation vector in angle-axis convention.

:math:`(t_x, t_y, t_z)` is the translation vector.

.. autofunction:: inverse_pose
.. autofunction:: pinhole_matrix
.. autofunction:: inverse_pinhole_matrix
.. autofunction:: scale_pinhole
.. autofunction:: homography_i_H_ref

.. autoclass:: InversePose
.. autoclass:: PinholeMatrix
.. autoclass:: InversePinholeMatrix
8 changes: 8 additions & 0 deletions docs/source/utils.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
torchgeometry.utils
===================

.. currentmodule:: torchgeometry.utils

.. autofunction:: tensor_to_image
.. autofunction:: image_to_tensor

17 changes: 12 additions & 5 deletions examples/warp_affine.ipynb → docs/source/warp_affine.ipynb

Large diffs are not rendered by default.

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions docs/source/warping.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Warping
-------

.. currentmodule:: torchgeometry

.. autoclass:: HomographyWarper
:members:

.. autoclass:: DepthWarper
:members:

.. autofunction:: homography_warp
.. autofunction:: depth_warp
1 change: 1 addition & 0 deletions setup_dev_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ $sdk_dir/.dev_env/bin/conda install -y \
opencv \
sphinx \
sphinx_rtd_theme \
nbsphinx \
-c pytorch

$sdk_dir/.dev_env/bin/conda clean -ya

0 comments on commit 39eb046

Please sign in to comment.