Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

refactor docs page and tutorials

edgarribafe797ee6b00c
diff --git a/docs/requirements.txt b/docs/requirements.txt
index 35d388dc7..e96021224 100644
--- a/docs/requirements.txt
+++ b/docs/requirements.txt
@@ -1,2 +1,3 @@
sphinx==1.6.6
sphinx_rtd_theme==0.2.4
+nbsphinx
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 5dfbf79f7..2e5170ab3 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -22,6 +22,7 @@ extensions = [
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
+ 'nbsphinx',
]
napoleon_use_ivar = True
@@ -36,15 +37,15 @@ templates_path = ['_templates']
# 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
@@ -67,7 +68,7 @@ language = None
# 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'
@@ -112,7 +113,7 @@ html_context = {
# -- Options for HTMLHelp output ------------------------------------------
# Output file base name for HTML help builder.
-htmlhelp_basename = 'PyTorchdoc'
+htmlhelp_basename = 'PyTorchGeometry'
# -- Options for LaTeX output ---------------------------------------------
@@ -140,7 +141,7 @@ latex_elements = {
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'pytorch.tex', 'torchgeometry Documentation',
- 'Torch Contributors', 'manual'),
+ 'Arraiy', 'manual'),
]
diff --git a/docs/source/conversions.rst b/docs/source/conversions.rst
new file mode 100644
index 000000000..bf286a2df
--- /dev/null
+++ b/docs/source/conversions.rst
@@ -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
diff --git a/docs/source/data/bennett_aden.png b/docs/source/data/bennett_aden.png
new file mode 100644
index 000000000..d147ea1d1
Binary files /dev/null and b/docs/source/data/bennett_aden.png differ
diff --git a/docs/source/data/bruce.png b/docs/source/data/bruce.png
new file mode 100644
index 000000000..eb80bde86
Binary files /dev/null and b/docs/source/data/bruce.png differ
diff --git a/docs/source/geometric.rst b/docs/source/geometric.rst
new file mode 100644
index 000000000..85680f62d
--- /dev/null
+++ b/docs/source/geometric.rst
@@ -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
diff --git a/docs/source/image.rst b/docs/source/image.rst
new file mode 100644
index 000000000..2d9df6fa5
--- /dev/null
+++ b/docs/source/image.rst
@@ -0,0 +1,6 @@
+torchgeometry.image
+===================
+
+.. currentmodule:: torchgeometry.image
+
+.. autofunction:: get_gaussian_kernel
diff --git a/docs/source/index.rst b/docs/source/index.rst
index 773837cf4..24bcea4b2 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -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`
diff --git a/docs/source/pinhole.rst b/docs/source/pinhole.rst
new file mode 100644
index 000000000..544a01446
--- /dev/null
+++ b/docs/source/pinhole.rst
@@ -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
diff --git a/docs/source/utils.rst b/docs/source/utils.rst
new file mode 100644
index 000000000..542acc996
--- /dev/null
+++ b/docs/source/utils.rst
@@ -0,0 +1,8 @@
+torchgeometry.utils
+===================
+
+.. currentmodule:: torchgeometry.utils
+
+.. autofunction:: tensor_to_image
+.. autofunction:: image_to_tensor
+
diff --git a/docs/source/warping.rst b/docs/source/warping.rst
new file mode 100644
index 000000000..d55b11adc
--- /dev/null
+++ b/docs/source/warping.rst
@@ -0,0 +1,13 @@
+Warping
+-------
+
+.. currentmodule:: torchgeometry
+
+.. autoclass:: HomographyWarper
+ :members:
+
+.. autoclass:: DepthWarper
+ :members:
+
+.. autofunction:: homography_warp
+.. autofunction:: depth_warp
diff --git a/setup_dev_env.sh b/setup_dev_env.sh
index adac2a097..294259708 100755
--- a/setup_dev_env.sh
+++ b/setup_dev_env.sh
@@ -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