Add implicitron to readthedocs

Summary: Try to document implicitron. Most of this is autogenerated.

Reviewed By: shapovalov

Differential Revision: D40623742

fbshipit-source-id: 453508277903b7d987b1703656ba1ee09bc2c570
This commit is contained in:
Jeremy Reizenstein 2022-10-31 14:44:41 -07:00 committed by Facebook GitHub Bot
parent 322c8f2f50
commit cd113efd98
43 changed files with 589 additions and 0 deletions

View File

@ -0,0 +1,120 @@
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
"""
This script makes the stubs for implicitron in docs/modules.
"""
from pathlib import Path
ROOT_DIR = Path(__file__).resolve().parent.parent
DEST_DIR = Path(__file__).resolve().parent / "modules/implicitron"
def paths_to_modules(paths):
"""
Given an iterable of paths, return equivalent list of modules.
"""
return [str(i.relative_to(ROOT_DIR))[:-3].replace("/", ".") for i in paths]
def create_one_file(title, description, sources, dest_file):
with open(dest_file, "w") as f:
print(title, file=f)
print("=" * len(title), file=f)
print(file=f)
print(description, file=f)
for source in sources:
if source.find("._") != -1:
# ignore internal modules including __init__.py
continue
print(f"\n.. automodule:: {source}", file=f)
print(" :members:", file=f)
print(" :undoc-members:", file=f)
print(" :show-inheritance:", file=f)
def iterate_directory(directory_path, dest):
"""
Create a file for each module in the given path
"""
toc = []
if not dest.exists():
dest.mkdir()
for file in directory_path.glob("*.py"):
if file.stem.startswith("_"):
continue
module = paths_to_modules([file])
create_one_file(module[0], file.stem, module, dest / f"{file.stem}.rst")
toc.append(file.stem)
for subdir in directory_path.iterdir():
if not subdir.is_dir():
continue
if subdir.name == "fb":
continue
iterate_directory(subdir, dest / (subdir.name))
toc.append(f"{subdir.name}/index")
with open(dest / "index.rst", "w") as f:
title = paths_to_modules([directory_path.with_suffix(".XX")])[0]
print(title, file=f)
print("=" * len(title), file=f)
print("\n.. toctree::\n", file=f)
for item in toc:
print(f" {item}", file=f)
iterate_directory(ROOT_DIR / "pytorch3d/implicitron/models", DEST_DIR / "models")
unwanted_tools = ["configurable", "depth_cleanup", "utils"]
tools_sources = sorted(ROOT_DIR.glob("pytorch3d/implicitron/tools/*.py"))
tools_modules = [
str(i.relative_to(ROOT_DIR))[:-3].replace("/", ".")
for i in tools_sources
if i.stem not in unwanted_tools
]
create_one_file(
"pytorch3d.implicitron.tools",
"Tools for implicitron",
tools_modules,
DEST_DIR / "tools.rst",
)
dataset_files = sorted(ROOT_DIR.glob("pytorch3d/implicitron/dataset/*.py"))
basic_dataset = [
"dataset_base",
"dataset_map_provider",
"data_loader_map_provider",
"data_source",
"scene_batch_sampler",
]
basic_dataset_modules = [f"pytorch3d.implicitron.dataset.{i}" for i in basic_dataset]
create_one_file(
"pytorch3d.implicitron.dataset",
"Basics of data for implicitron",
basic_dataset_modules,
DEST_DIR / "data_basics.rst",
)
specific_dataset_files = [
i for i in dataset_files if i.stem.find("_dataset_map_provider") != -1
]
create_one_file(
"pytorch3d.impliciton.dataset",
"specific datasets",
paths_to_modules(specific_dataset_files),
DEST_DIR / "datasets.rst",
)
evaluation_files = sorted(ROOT_DIR.glob("pytorch3d/implicitron/evaluation/*.py"))
create_one_file(
"pytorch3d.impliciton.evaluation",
"evaluation",
paths_to_modules(evaluation_files),
DEST_DIR / "evaluation.rst",
)

View File

@ -0,0 +1,29 @@
pytorch3d.implicitron.dataset
=============================
Basics of data for implicitron
.. automodule:: pytorch3d.implicitron.dataset.dataset_base
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.dataset.dataset_map_provider
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.dataset.data_loader_map_provider
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.dataset.data_source
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.dataset.scene_batch_sampler
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,29 @@
pytorch3d.impliciton.dataset
============================
specific datasets
.. automodule:: pytorch3d.implicitron.dataset.blender_dataset_map_provider
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.dataset.json_index_dataset_map_provider
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.dataset.json_index_dataset_map_provider_v2
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.dataset.llff_dataset_map_provider
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.dataset.rendered_mesh_dataset_map_provider
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,14 @@
pytorch3d.impliciton.evaluation
===============================
evaluation
.. automodule:: pytorch3d.implicitron.evaluation.evaluate_new_view_synthesis
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.evaluation.evaluator
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,9 @@
pytorch3d.implicitron.models.base_model
=======================================
base_model
.. automodule:: pytorch3d.implicitron.models.base_model
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,9 @@
pytorch3d.implicitron.models.feature_extractor.feature_extractor
================================================================
feature_extractor
.. automodule:: pytorch3d.implicitron.models.feature_extractor.feature_extractor
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,7 @@
pytorch3d.implicitron.models.feature_extractor
==============================================
.. toctree::
feature_extractor
resnet_feature_extractor

View File

@ -0,0 +1,9 @@
pytorch3d.implicitron.models.feature_extractor.resnet_feature_extractor
=======================================================================
resnet_feature_extractor
.. automodule:: pytorch3d.implicitron.models.feature_extractor.resnet_feature_extractor
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,9 @@
pytorch3d.implicitron.models.generic_model
==========================================
generic_model
.. automodule:: pytorch3d.implicitron.models.generic_model
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,9 @@
pytorch3d.implicitron.models.global_encoder.autodecoder
=======================================================
autodecoder
.. automodule:: pytorch3d.implicitron.models.global_encoder.autodecoder
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,9 @@
pytorch3d.implicitron.models.global_encoder.global_encoder
==========================================================
global_encoder
.. automodule:: pytorch3d.implicitron.models.global_encoder.global_encoder
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,7 @@
pytorch3d.implicitron.models.global_encoder
===========================================
.. toctree::
autodecoder
global_encoder

View File

@ -0,0 +1,9 @@
pytorch3d.implicitron.models.implicit_function.base
===================================================
base
.. automodule:: pytorch3d.implicitron.models.implicit_function.base
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,9 @@
pytorch3d.implicitron.models.implicit_function.decoding_functions
=================================================================
decoding_functions
.. automodule:: pytorch3d.implicitron.models.implicit_function.decoding_functions
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,9 @@
pytorch3d.implicitron.models.implicit_function.idr_feature_field
================================================================
idr_feature_field
.. automodule:: pytorch3d.implicitron.models.implicit_function.idr_feature_field
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,13 @@
pytorch3d.implicitron.models.implicit_function
==============================================
.. toctree::
base
decoding_functions
idr_feature_field
neural_radiance_field
scene_representation_networks
utils
voxel_grid
voxel_grid_implicit_function

View File

@ -0,0 +1,9 @@
pytorch3d.implicitron.models.implicit_function.neural_radiance_field
====================================================================
neural_radiance_field
.. automodule:: pytorch3d.implicitron.models.implicit_function.neural_radiance_field
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,9 @@
pytorch3d.implicitron.models.implicit_function.scene_representation_networks
============================================================================
scene_representation_networks
.. automodule:: pytorch3d.implicitron.models.implicit_function.scene_representation_networks
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,9 @@
pytorch3d.implicitron.models.implicit_function.utils
====================================================
utils
.. automodule:: pytorch3d.implicitron.models.implicit_function.utils
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,9 @@
pytorch3d.implicitron.models.implicit_function.voxel_grid
=========================================================
voxel_grid
.. automodule:: pytorch3d.implicitron.models.implicit_function.voxel_grid
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,9 @@
pytorch3d.implicitron.models.implicit_function.voxel_grid_implicit_function
===========================================================================
voxel_grid_implicit_function
.. automodule:: pytorch3d.implicitron.models.implicit_function.voxel_grid_implicit_function
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,15 @@
pytorch3d.implicitron.models
============================
.. toctree::
base_model
generic_model
metrics
model_dbir
feature_extractor/index
global_encoder/index
implicit_function/index
renderer/index
view_pooler/index
visualization/index

View File

@ -0,0 +1,9 @@
pytorch3d.implicitron.models.metrics
====================================
metrics
.. automodule:: pytorch3d.implicitron.models.metrics
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,9 @@
pytorch3d.implicitron.models.model_dbir
=======================================
model_dbir
.. automodule:: pytorch3d.implicitron.models.model_dbir
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,9 @@
pytorch3d.implicitron.models.renderer.base
==========================================
base
.. automodule:: pytorch3d.implicitron.models.renderer.base
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,14 @@
pytorch3d.implicitron.models.renderer
=====================================
.. toctree::
base
lstm_renderer
multipass_ea
ray_point_refiner
ray_sampler
ray_tracing
raymarcher
rgb_net
sdf_renderer

View File

@ -0,0 +1,9 @@
pytorch3d.implicitron.models.renderer.lstm_renderer
===================================================
lstm_renderer
.. automodule:: pytorch3d.implicitron.models.renderer.lstm_renderer
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,9 @@
pytorch3d.implicitron.models.renderer.multipass_ea
==================================================
multipass_ea
.. automodule:: pytorch3d.implicitron.models.renderer.multipass_ea
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,9 @@
pytorch3d.implicitron.models.renderer.ray_point_refiner
=======================================================
ray_point_refiner
.. automodule:: pytorch3d.implicitron.models.renderer.ray_point_refiner
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,9 @@
pytorch3d.implicitron.models.renderer.ray_sampler
=================================================
ray_sampler
.. automodule:: pytorch3d.implicitron.models.renderer.ray_sampler
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,9 @@
pytorch3d.implicitron.models.renderer.ray_tracing
=================================================
ray_tracing
.. automodule:: pytorch3d.implicitron.models.renderer.ray_tracing
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,9 @@
pytorch3d.implicitron.models.renderer.raymarcher
================================================
raymarcher
.. automodule:: pytorch3d.implicitron.models.renderer.raymarcher
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,9 @@
pytorch3d.implicitron.models.renderer.rgb_net
=============================================
rgb_net
.. automodule:: pytorch3d.implicitron.models.renderer.rgb_net
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,9 @@
pytorch3d.implicitron.models.renderer.sdf_renderer
==================================================
sdf_renderer
.. automodule:: pytorch3d.implicitron.models.renderer.sdf_renderer
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,9 @@
pytorch3d.implicitron.models.view_pooler.feature_aggregator
===========================================================
feature_aggregator
.. automodule:: pytorch3d.implicitron.models.view_pooler.feature_aggregator
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,8 @@
pytorch3d.implicitron.models.view_pooler
========================================
.. toctree::
feature_aggregator
view_pooler
view_sampler

View File

@ -0,0 +1,9 @@
pytorch3d.implicitron.models.view_pooler.view_pooler
====================================================
view_pooler
.. automodule:: pytorch3d.implicitron.models.view_pooler.view_pooler
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,9 @@
pytorch3d.implicitron.models.view_pooler.view_sampler
=====================================================
view_sampler
.. automodule:: pytorch3d.implicitron.models.view_pooler.view_sampler
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,6 @@
pytorch3d.implicitron.models.visualization
==========================================
.. toctree::
render_flyaround

View File

@ -0,0 +1,9 @@
pytorch3d.implicitron.models.visualization.render_flyaround
===========================================================
render_flyaround
.. automodule:: pytorch3d.implicitron.models.visualization.render_flyaround
:members:
:undoc-members:
:show-inheritance:

View File

@ -0,0 +1,64 @@
pytorch3d.implicitron.tools
===========================
Tools for implicitron
.. automodule:: pytorch3d.implicitron.tools.camera_utils
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.tools.circle_fitting
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.tools.config
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.tools.eval_video_trajectory
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.tools.image_utils
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.tools.metric_utils
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.tools.model_io
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.tools.point_cloud_utils
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.tools.rasterize_mc
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.tools.stats
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.tools.video_writer
:members:
:undoc-members:
:show-inheritance:
.. automodule:: pytorch3d.implicitron.tools.vis_utils
:members:
:undoc-members:
:show-inheritance:

View File

@ -13,3 +13,4 @@ API Documentation
datasets
common
vis
implicitron/index

View File

@ -9,3 +9,4 @@ iopath
fvcore
https://download.pytorch.org/whl/cpu/torchvision-0.8.2%2Bcpu-cp37-cp37m-linux_x86_64.whl
https://download.pytorch.org/whl/cpu/torch-1.7.1%2Bcpu-cp37-cp37m-linux_x86_64.whl
omegaconf