Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
LinZhuoChen committed Aug 10, 2024
1 parent b8dee37 commit d7fbf35
Show file tree
Hide file tree
Showing 60 changed files with 855 additions and 319 deletions.
Binary file modified .doctrees/API.doctree
Binary file not shown.
Binary file modified .doctrees/code/dataset.doctree
Binary file not shown.
Binary file modified .doctrees/code/hook.doctree
Binary file not shown.
Binary file modified .doctrees/code/logger.doctree
Binary file not shown.
Binary file modified .doctrees/code/model.doctree
Binary file not shown.
Binary file modified .doctrees/code/optimizer.doctree
Binary file not shown.
Binary file modified .doctrees/code/point_cloud.doctree
Binary file not shown.
Binary file modified .doctrees/code/trainer.doctree
Binary file not shown.
Binary file modified .doctrees/environment.pickle
Binary file not shown.
Binary file modified .doctrees/framework/data.doctree
Binary file not shown.
Binary file modified .doctrees/framework/model.doctree
Binary file not shown.
Binary file modified .doctrees/framework/overall.doctree
Binary file not shown.
Binary file modified .doctrees/framework_cn/data.doctree
Binary file not shown.
Binary file modified .doctrees/framework_cn/model.doctree
Binary file not shown.
Binary file modified .doctrees/framework_cn/overall.doctree
Binary file not shown.
Binary file modified .doctrees/get_started_cn/learning_config.doctree
Binary file not shown.
Binary file modified .doctrees/index.doctree
Binary file not shown.
Binary file modified .doctrees/index_cn.doctree
Binary file not shown.
54 changes: 23 additions & 31 deletions API.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="dataset" href="code/dataset.html" />
<link rel="prev" title="Export mesh" href="advanced_usage/extract_mesh.html" />
<link rel="prev" title="mesh 提取" href="advanced_usage_cn/extract_mesh.html" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
</head>
Expand Down Expand Up @@ -128,7 +128,7 @@



<a class="navbar-brand logo" href="index.html">
<a class="navbar-brand logo" href="index_cn.html">



Expand Down Expand Up @@ -157,37 +157,36 @@
</script></div>
<div class="sidebar-primary-item"><nav class="bd-links bd-docs-nav" aria-label="Main">
<div class="bd-toc-item navbar-nav active">
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Get started (In 10 minutes)</span></p>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">开始(10分钟内学习Pointrix)</span></p>
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="get_started/installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="get_started/run_first_model.html">Run Your First Model</a></li>
<li class="toctree-l1"><a class="reference internal" href="get_started/render_novel_view_gui.html">Using Pointflicks (GUI)</a></li>
<li class="toctree-l1"><a class="reference internal" href="get_started/learning_configuration.html">Configuration Files in Pointrix</a></li>
<li class="toctree-l1"><a class="reference internal" href="get_started_cn/installation.html">安装</a></li>
<li class="toctree-l1"><a class="reference internal" href="get_started_cn/run_first_model.html">运行你的第一个模型</a></li>
<li class="toctree-l1"><a class="reference internal" href="get_started_cn/learning_config.html">Pointrix 中的配置文件</a></li>
<li class="toctree-l1"><a class="reference internal" href="get_started_cn/render_novel_view_gui.html">使用 Pointflicks (GUI) 可视化</a></li>
</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Tutorial</span></p>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">教程</span></p>
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="tutorial/tutorial_2.html">Adding Supervision for 3DGS</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial_cn/tutorial_2.html">为点云渲染添加监督</a></li>
</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Framework</span></p>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">架构</span></p>
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="framework/overall.html">Overview</a></li>
<li class="toctree-l1"><a class="reference internal" href="framework/data.html">Data Pipeline</a></li>
<li class="toctree-l1"><a class="reference internal" href="framework/model.html">Model</a></li>
<li class="toctree-l1"><a class="reference internal" href="framework/trainer.html">Trainer</a></li>
<li class="toctree-l1"><a class="reference internal" href="framework/hook.html">Hook</a></li>
<li class="toctree-l1"><a class="reference internal" href="framework_cn/overall.html">总览</a></li>
<li class="toctree-l1"><a class="reference internal" href="framework_cn/data.html">数据流水线</a></li>
<li class="toctree-l1"><a class="reference internal" href="framework_cn/model.html">模型</a></li>
<li class="toctree-l1"><a class="reference internal" href="framework_cn/trainer.html">训练器 (Trainer)</a></li>
<li class="toctree-l1"><a class="reference internal" href="framework_cn/hook.html">钩子</a></li>
</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Advanced</span></p>
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="advanced_usage/camera_optimization.html">Camera Optimization</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced_usage/dust3r_init.html">Initilization of Point Cloud</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced_usage/extract_mesh.html">Export mesh</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced_usage_cn/camera_optimization.html">相机优化</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced_usage_cn/dust3r_init.html">使用Dust3r 初始化相机模型与点云</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced_usage_cn/extract_mesh.html">mesh 提取</a></li>
</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Reference</span></p>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">参考</span></p>
<ul class="current nav bd-sidenav">
<li class="toctree-l1 current active has-children"><a class="current reference internal" href="#">API</a><details open="open"><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
<li class="toctree-l2"><a class="reference internal" href="code/dataset.html">dataset</a></li>
<li class="toctree-l2"><a class="reference internal" href="code/point_cloud.html">point_cloud</a></li>
<li class="toctree-l2"><a class="reference internal" href="code/exporter.html">exporter</a></li>
<li class="toctree-l2"><a class="reference internal" href="code/hook.html">hook</a></li>
<li class="toctree-l2"><a class="reference internal" href="code/logger.html">logger</a></li>
<li class="toctree-l2"><a class="reference internal" href="code/model.html">model</a></li>
Expand All @@ -197,7 +196,8 @@
</details></li>
</ul>
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="switch.html"><a href="https://pointrix-project.github.io/pointrix/index_cn.html">简体中文</a></a></li>
<li class="toctree-l1"><a class="reference internal" href="switch_cn.html"><a href="https://pointrix-project.github.io/pointrix/index.html">English</a></a></li>

</ul>

</div>
Expand Down Expand Up @@ -408,14 +408,6 @@ <h1>API<a class="headerlink" href="#api" title="Link to this heading">#</a></h1>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="code/exporter.html">exporter</a><ul>
<li class="toctree-l2"><a class="reference internal" href="code/exporter.html#module-pointrix.exporter.novel_view">Render the novel view.</a><ul>
<li class="toctree-l3"><a class="reference internal" href="code/exporter.html#pointrix.exporter.novel_view.novel_view_render"><code class="docutils literal notranslate"><span class="pre">novel_view_render()</span></code></a></li>
<li class="toctree-l3"><a class="reference internal" href="code/exporter.html#pointrix.exporter.novel_view.test_view_render"><code class="docutils literal notranslate"><span class="pre">test_view_render()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="code/hook.html">hook</a><ul>
<li class="toctree-l2"><a class="reference internal" href="code/hook.html#pointrix.hook.base_hook.Hook"><code class="docutils literal notranslate"><span class="pre">Hook</span></code></a><ul>
<li class="toctree-l3"><a class="reference internal" href="code/hook.html#pointrix.hook.base_hook.Hook.after_load_checkpoint"><code class="docutils literal notranslate"><span class="pre">Hook.after_load_checkpoint()</span></code></a></li>
Expand Down Expand Up @@ -591,12 +583,12 @@ <h1>API<a class="headerlink" href="#api" title="Link to this heading">#</a></h1>

<div class="prev-next-area">
<a class="left-prev"
href="advanced_usage/extract_mesh.html"
href="advanced_usage_cn/extract_mesh.html"
title="previous page">
<i class="fa-solid fa-angle-left"></i>
<div class="prev-next-info">
<p class="prev-next-subtitle">previous</p>
<p class="prev-next-title">Export mesh</p>
<p class="prev-next-title">mesh 提取</p>
</div>
</a>
<a class="right-next"
Expand Down
2 changes: 1 addition & 1 deletion _sources/API.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ API
TODO: Explanation of each component

.. toctree::

code/dataset
code/point_cloud
code/exporter
code/hook
code/logger
code/model
Expand Down
42 changes: 42 additions & 0 deletions _sources/framework/data.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,49 @@ As shown in the diagram below, the data pipeline consists of two main components

![](../../images/data.png)


## Dataset

The Dataset defines three basic data types: **Observation**, **Camera Priors**, and **Point Cloud Priors**.
- **Observation**: Refers to the data captured by the camera, typically including RGB images. Common observations include RGB images, depth maps, surface normals, etc. These observations are usually used as supervision for the model.

- **Camera Priors**: Mainly include the intrinsic and extrinsic parameters of the camera, which are prior information about the camera model. They are typically used as priors for the camera in the model. If the camera priors are accurate enough (e.g., camera poses obtained via Colmap), users may choose not to optimize the camera model and directly use the intrinsic and extrinsic parameters from the camera priors as input for rendering.

- **Point Cloud Priors**: Point cloud priors obtained through random sampling/Dust3R/Colmap, used as the initialization for the point cloud model.

```{note}
To load custom datasets, users must override functions corresponding to *observation*, *camera priors*, and *point cloud priors*. For relevant examples, refer to the tutorial on **Adding Supervision to Point Clouds**.
```

## DataPipeline

Once the functions for loading Observations, Camera Priors, and Point Cloud Priors are defined in the dataset section, the DataPipeline will automatically handle the data flow through the `next_train()` and `next_val()` functions to provide data streams for the training process. It will also supply Point Cloud Priors and Camera Priors for model testing. Users generally do not need to concern themselves with these details.

## Related Configuration

```yaml
trainer:
datapipeline:
data_set: "ColmapDataset"
shuffle: True
batch_size: 1
num_workers: 0
dataset:
data_path: "/home/linzhuo/gj/data/garden"
cached_observed_data: True
scale: 0.25
white_bg: False
observed_data_dirs_dict: {"image": "images"}
```
- `data_path`: The path to the dataset.
- `data_set`: The type of dataset, indexed by the registry.
- `shuffle`: Whether to shuffle the data randomly.
- `batch_size`: The batch size.
- `num_workers`: The number of workers in the dataloader.
- `dataset`
- `cached_observed_data`: Whether to use cached data for loading.
- `scale`: The scale of the images.
- `white_bg`: Whether to use a white background.
- `observed_data_dirs_dict`: \{key: value\}, where the key is the name of the observation variable and the value is the path to the observation. For example, \{"image": "images"\} means that the path for the observation variable named "image" is `self.data_root/images`.

63 changes: 62 additions & 1 deletion _sources/framework/model.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,65 @@ The interaction between the model and optimizer during training in Pointrix is i

![](../../images/model.png)

The data passed to the model includes **Point Cloud Priors**, **Observations**, and **Camera Priors**, all provided by the data pipeline on the left.
The data passed to the model includes **Point Cloud Priors**, **Observations**, and **Camera Priors**, all provided by the data pipeline on the left.

## Model

The model consists of three main components:

- **Point Cloud Model**: An optimizable point cloud model where users can extend its features by registering optimizable attributes. For example:
```python
point_cloud = PointsCloud(cfg)
point_cloud.register_attribute('position', position)
point_cloud.register_attribute('rgb', rgb)
```
With the above code, users register 'position' and 'rgb' attributes for each point in the point cloud. Users can extend the point cloud's features by defining custom attributes. For instance, Gaussian point clouds may include attributes such as 'sh', 'scale', 'rotation', 'opacity', and 'position'.

- **Camera Model**: Mainly includes three optimizable attributes: `qrots`, `tvecs`, and `intrs`, representing rotation, translation, and camera intrinsic parameters. Support for extending custom attributes will be added in the future.

- **Renderer**: Includes support for various rendering methods such as the original Gaussian kernel, Gsplat, and Msplat. Typically, as shown in the figure, the renderer reads the camera and point cloud data for the corresponding viewpoints from the model and outputs the rendered results.

## Optimizer and Controller

The optimizer is responsible for updating the model parameters, while the controller is responsible for updating the model structure (usually the point cloud model).

## Related Configuration

### Model Configuration:
```yaml
trainer:
model:
name: BaseModel
lambda_ssim: 0.2
point_cloud:
point_cloud_type: "GaussianPointCloud"
max_sh_degree: 3
trainable: true
unwarp_prefix: "point_cloud"
initializer:
init_type: 'colmap'
feat_dim: 3
camera_model:
enable_training: False
renderer:
name: "MsplatRender"
render_depth: True
max_sh_degree: ${trainer.model.point_cloud.max_sh_degree}
```
- `name`: The name of the model, which will be looked up in the registry.
- `lambda_ssim`: The weight for the SSIM loss.
- `point_cloud`
- `point_cloud_type`: The type of point cloud; 'GaussianPointCloud' is used for Gaussian Splatting-based methods.
- `max_sh_degree`: The maximum SH degree in Pointrix.
- `trainable`: Whether the point cloud model is trainable.
- `unwarp_prefix`: A prefix used to differentiate between different point cloud groups in the optimizer; generally, this is not a concern unless multiple point clouds are needed.
- `initializer`
- `init_type`: The initialization method for the point cloud, including 'colmap' and 'random'.
- `feat_dim`: The feature dimension of the point cloud used for rendering RGB.
- `camera_model`
- `enable_training`: Whether to enable camera optimization.
- `renderer`
- `name`: MSplat, GSplat, or the original Gaussian kernel, which will be indexed by the registry.
- `max_sh_degree`: The maximum SH degree for the renderer.
- `render_depth`: Whether to render depth.
5 changes: 2 additions & 3 deletions _sources/framework/overall.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@ Pointrix is a powerful and easily extensible framework built around point cloud
- Supports current mainstream Gaussian point cloud work.

The overall framework of Pointrix is illustrated in the diagram below:
![](../../images/framework_new.png)

## Data Components
- **Dataset Reader**: Parses various types of data provided by developers into a unified data format.
- **Data Pipeline**: Manages the flow of unified data format to the trainer.

## Model Components
- **Point Cloud Model**: Computation graph component based on Gaussian point clouds.
- **Point Cloud Camera Model**: Computation graph component based on Gaussian point clouds and camera models.
- **Msplat Renderer**: Core component of point cloud rendering. Supports various rendering techniques. All inputs return gradients (camera intrinsic and extrinsic parameters), and interfaces are modularized to the extent possible.
- **Camera Model**:Computation graph component based on Camera model。
- **Post-processing**: Post-processing steps such as rendering from new viewpoints and mesh extraction on the final trained point cloud.

## Logging, Visualization, Configuration, Registration, and Callback Components
- **Logger and GUI**: Interact with all components, supporting logging and visualization of intermediate results generated throughout the process.
Expand Down
46 changes: 45 additions & 1 deletion _sources/framework_cn/data.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# 数据流水线

## 总览
如下图所示,数据流水线由两个部分组成:**Dataset****DataPipeline**

- **Dataset**:负责标准化用户数据集,即将它们转换为 Pointrix 的统一数据格式:这个数据格式包含三部分,**相机先验****点云先验**,以及**观测信息**。相机先验主要包含相机的内外参信息,
Expand All @@ -10,7 +11,50 @@
![](../../images/data.png)


## Dataset

Dataset 中定义了三种基本数据类型,包括**观测****相机先验**,和**点云先验**
- **观测**:即为相机的观测,默认包含RGB图片,常见的观测包括RGB图片,深度图,表面法向等信息。这些观测通常作为模型的监督。

- **相机先验**:主要包含相机的内外参等相机模型的先验信息,通常作为模型测相机的先验,如果相机先验足够准确 (例如通过Colmap获得的相机位姿),用户可以选择不优化相机模型,直接采用相机先验中的内外参作为渲染的输入。

- **点云先验**:通过随机/Dust3R/Colmap 获得的点云先验,作为点云模型的初始化。


```{note}
如果需要载入用户自定义的数据集,用户需要重载修改对应的*观测*,*相机先验*,以及 *点云先验*对应的函数。
相关例子可以看教程中的**为点云添加监督**。
```
```

## DataPipeline

在数据集部分定义好了观测,相机先验以及点云先验的载入函数后,DataPipeline 会自动处理,通过`next_train()``next_val()`
函数来为训练过程提供数据流,同时会为模型测提供点云先验以及相机先验。用户通常不需要关心这部分的细节。

## 相关配置

```yaml
trainer:
datapipeline:
data_set: "ColmapDataset"
shuffle: True
batch_size: 1
num_workers: 0
dataset:
data_path: "/home/linzhuo/gj/data/garden"
cached_observed_data: True
scale: 0.25
white_bg: False
observed_data_dirs_dict: {"image":"images"}
```
- data_path: 数据集的路径
- data_set: 数据集的类型,由注册器索引。
- shuffle: 是否随机打乱数据
- batch_size: 批处理大小
- num_workers: dataloader 中的num_workers
- dataset
- cached_metadata: 是否引入缓存加载数据
- scale: 图片尺度大小
- white_bg: 是否白色背景
- observed_data_dirs_dict:\{key: value\}, 其中key为观测的变量名,value为观测的路径。例如\{"image": "images"\}, 表示为,观测变量名为image的路径为self.data_root/images.
Loading

0 comments on commit d7fbf35

Please sign in to comment.