# cocel-postech/pit-nbv architecture

> Architecture diagram of the GitHub repository cocel-postech/pit-nbv, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cocel-postech/pit-nbv
- Repository: https://github.com/cocel-postech/pit-nbv

## Overview

PIT-NBV learns 6-DOF next-best-view poses from partial point clouds and evaluates reconstruction-view quality. Its main workflow prepares ShapeNet splits, generates Poisson-guided scan sequences and NBV labels, packs them into HDF5, then trains or evaluates a point-cloud transformer. The graph preserves the documented stages and their principal dependencies; test.py and some dataset-generation details are not sampled, so those links rely on README statements rather than source inspection.

Main entry points: [`supervision_dataset/2_poisson_gen_nbv_data.py`](https://github.com/cocel-postech/pit-nbv/blob/main/supervision_dataset/2_poisson_gen_nbv_data.py) (Scan sequence generation), [`network/pct_v.py`](https://github.com/cocel-postech/pit-nbv/blob/main/network/pct_v.py) (Point transformer), [`train.py`](https://github.com/cocel-postech/pit-nbv/blob/main/train.py) (Training loop), [`dataloader_poisson.py`](https://github.com/cocel-postech/pit-nbv/blob/main/dataloader_poisson.py) (Poisson data loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Dataset preparation"]
  node_split["Dataset split<br/>[1_split_dataset.py]"]
  node_hdf["HDF5 dataset builder"]
  node_hdfstore[("HDF5 dataset")]
end

subgraph group_planning["Poisson view planning"]
  node_sequence["Scan sequence generation"]
  node_poisson["Poisson utilities<br/>[poisson_util.py]"]
  node_scanfiles["PCD and NBV files"]
end

subgraph group_learning["Model learning"]
  node_loader["Poisson data loader"]
  node_model["Point transformer<br/>[pct_v.py]"]
  node_pointnet["PointNet operations<br/>[pointnet_util.py]"]
  node_loss["NBV loss<br/>[loss.py]"]
end

subgraph group_runtime["Training and evaluation"]
  node_trainer["Training loop<br/>[train.py]"]
  node_evaluator["Evaluation entry<br/>[test.py]"]
  node_viewresult["Predicted view pose"]
end

node_shapenet[("ShapeNet source")]
node_autoscanner["Autoscanning tool"]

node_shapenet -->|"provides meshes"| node_split
node_split -.->|"supplies split data"| node_sequence
node_sequence -->|"uses geometry helpers"| node_poisson
node_sequence -->|"runs scan planner"| node_autoscanner
node_sequence -->|"writes scans and labels"| node_scanfiles
node_scanfiles -.->|"provides PCD and CSV"| node_hdf
node_hdf -->|"writes grouped data"| node_hdfstore
node_hdfstore -->|"loads samples"| node_loader
node_loader -->|"feeds batches"| node_trainer
node_trainer -->|"runs forward pass"| node_model
node_trainer -->|"computes objective"| node_loss
node_model -->|"uses sampling ops"| node_pointnet
node_evaluator -.->|"evaluates dataset"| node_loader
node_evaluator -.->|"runs pretrained model"| node_model
node_model -->|"predicts pose"| node_viewresult

click node_split "https://github.com/cocel-postech/pit-nbv/blob/main/supervision_dataset/1_split_dataset.py"
click node_sequence "https://github.com/cocel-postech/pit-nbv/blob/main/supervision_dataset/2_poisson_gen_nbv_data.py"
click node_poisson "https://github.com/cocel-postech/pit-nbv/blob/main/util/poisson_util.py"
click node_hdf "https://github.com/cocel-postech/pit-nbv/blob/main/supervision_dataset/3_poisson_dataset_h5py.py"
click node_loader "https://github.com/cocel-postech/pit-nbv/blob/main/dataloader_poisson.py"
click node_model "https://github.com/cocel-postech/pit-nbv/blob/main/network/pct_v.py"
click node_pointnet "https://github.com/cocel-postech/pit-nbv/blob/main/util/pointnet_util.py"
click node_loss "https://github.com/cocel-postech/pit-nbv/blob/main/util/loss.py"
click node_trainer "https://github.com/cocel-postech/pit-nbv/blob/main/train.py"
click node_evaluator "https://github.com/cocel-postech/pit-nbv/blob/main/test.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_split,node_hdf,node_hdfstore toneBlue
class node_sequence,node_poisson,node_scanfiles,node_shapenet toneAmber
class node_loader,node_model,node_pointnet,node_loss toneMint
class node_trainer,node_evaluator,node_viewresult toneRose
class node_autoscanner toneIndigo
```

## Components

### Dataset preparation

- [Dataset split](https://github.com/cocel-postech/pit-nbv/blob/main/supervision_dataset/1_split_dataset.py): `supervision_dataset/1_split_dataset.py`
- [HDF5 dataset builder](https://github.com/cocel-postech/pit-nbv/blob/main/supervision_dataset/3_poisson_dataset_h5py.py): `supervision_dataset/3_poisson_dataset_h5py.py`
- **HDF5 dataset**

### Poisson view planning

- [Scan sequence generation](https://github.com/cocel-postech/pit-nbv/blob/main/supervision_dataset/2_poisson_gen_nbv_data.py): `supervision_dataset/2_poisson_gen_nbv_data.py`
- [Poisson utilities](https://github.com/cocel-postech/pit-nbv/blob/main/util/poisson_util.py): `util/poisson_util.py`
- **PCD and NBV files**

### Model learning

- [Poisson data loader](https://github.com/cocel-postech/pit-nbv/blob/main/dataloader_poisson.py): `dataloader_poisson.py`
- [Point transformer](https://github.com/cocel-postech/pit-nbv/blob/main/network/pct_v.py): `network/pct_v.py`
- [PointNet operations](https://github.com/cocel-postech/pit-nbv/blob/main/util/pointnet_util.py): `util/pointnet_util.py`
- [NBV loss](https://github.com/cocel-postech/pit-nbv/blob/main/util/loss.py): `util/loss.py`

### Training and evaluation

- [Training loop](https://github.com/cocel-postech/pit-nbv/blob/main/train.py): `train.py`
- [Evaluation entry](https://github.com/cocel-postech/pit-nbv/blob/main/test.py): `test.py`
- **Predicted view pose**

### Other components

- **ShapeNet source**
- **Autoscanning tool**

## Connections

- ShapeNet source → Dataset split: provides meshes (evidence: `supervision_dataset/1_split_dataset.py`)
- Dataset split → Scan sequence generation: supplies split data (evidence: `README.md`)
- Scan sequence generation → Poisson utilities: uses geometry helpers (evidence: `supervision_dataset/2_poisson_gen_nbv_data.py`)
- Scan sequence generation → Autoscanning tool: runs scan planner (evidence: `supervision_dataset/2_poisson_gen_nbv_data.py`)
- Scan sequence generation → PCD and NBV files: writes scans and labels (evidence: `supervision_dataset/2_poisson_gen_nbv_data.py`)
- PCD and NBV files → HDF5 dataset builder: provides PCD and CSV (evidence: `README.md`)
- HDF5 dataset builder → HDF5 dataset: writes grouped data (evidence: `supervision_dataset/3_poisson_dataset_h5py.py`)
- HDF5 dataset → Poisson data loader: loads samples (evidence: `dataloader_poisson.py`)
- Poisson data loader → Training loop: feeds batches (evidence: `train.py`)
- Training loop → Point transformer: runs forward pass (evidence: `train.py`)
- Training loop → NBV loss: computes objective (evidence: `train.py`)
- Point transformer → PointNet operations: uses sampling ops (evidence: `network/pct_v.py`)
- Evaluation entry → Poisson data loader: evaluates dataset (evidence: `README.md`)
- Evaluation entry → Point transformer: runs pretrained model (evidence: `README.md`)
- Point transformer → Predicted view pose: predicts pose (evidence: `network/pct_v.py`)
