cy0307 commited on
Commit
46330ce
·
verified ·
1 Parent(s): d3a98e4

Upload from Ropedia Academy

Browse files
Files changed (1) hide show
  1. README.md +72 -14
README.md CHANGED
@@ -4,19 +4,25 @@ library_name: pytorch
4
  tags:
5
  - ropedia-academy
6
  - educational
 
 
 
7
  - instant-ngp
8
  ---
9
 
10
  # Multiresolution hash grid (Instant-NGP)
11
 
12
- A multiresolution hash-grid feature encoding + tiny MLP that fits a real photograph to high PSNR — the trick that made NeRF ~1000× faster.
13
 
14
- Trained from scratch in **[Ropedia Academy](https://chaoyue0307.github.io/ropedia-academy/)** — an interactive, bilingual course on embodied & spatial AI. **Educational model:** small and quick to train; the value is the *method* and a reproducible pipeline, not a leaderboard score.
 
 
15
 
16
  | | |
17
  |---|---|
 
18
  | **Task** | differentiable image fitting |
19
- | **Data** | real photograph |
20
  | **Track** | B · 3D & rendering |
21
  | **Notebook** | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ChaoYue0307/ropedia-academy/blob/main/notebooks/training/B_hashgrid_instngp.ipynb) |
22
 
@@ -28,22 +34,50 @@ Trained from scratch in **[Ropedia Academy](https://chaoyue0307.github.io/ropedi
28
  - **Split:** single image (overfit)
29
  - **Source:** scikit-image data.astronaut() (NASA, public domain)
30
 
31
- ## Results
32
 
33
- | metric | value |
34
- |---|---|
35
- | psnr (final) | 64.25 |
 
 
 
 
36
 
37
 
38
  ![figure](figure.png)
39
 
40
- ## How to use
41
 
42
  ```python
43
  import torch
44
- state = torch.load("model.pt", map_location="cpu") # some labs save pose.pt / gaussians.pt / transform.pt
45
- # Rebuild the model class from the Ropedia Academy notebook (linked above), then:
46
- # model.load_state_dict(state)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  ```
48
 
49
  ## Files
@@ -53,10 +87,34 @@ state = torch.load("model.pt", map_location="cpu") # some labs save pose.pt /
53
  - `metrics.json`
54
 
55
 
56
- ## Reproduce / train your own
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
 
58
- Open the [lab notebook in Colab](https://colab.research.google.com/github/ChaoYue0307/ropedia-academy/blob/main/notebooks/training/B_hashgrid_instngp.ipynb) → **Runtime → GPU → Run all**, then its *Publish to the Hugging Face Hub* cell. Browse every lab in the [Ropedia Academy Labs tab](https://chaoyue0307.github.io/ropedia-academy/labs).
 
 
 
59
 
60
 
61
  ---
62
- *Part of the [Ropedia Academy](https://chaoyue0307.github.io/ropedia-academy/) trained-model collection.*
 
4
  tags:
5
  - ropedia-academy
6
  - educational
7
+ - embodied-ai
8
+ - from-scratch
9
+ - reproducible
10
  - instant-ngp
11
  ---
12
 
13
  # Multiresolution hash grid (Instant-NGP)
14
 
15
+ > A multiresolution hash-grid feature encoding + tiny MLP that fits a real photograph to high PSNR — the trick that made NeRF ~1000× faster.
16
 
17
+ Trained from scratch in **[Ropedia Academy](https://chaoyue0307.github.io/ropedia-academy/)** — an interactive, bilingual course on embodied & spatial AI. **Educational model:** small and quick to train; the value is the *method* and a reproducible pipeline, not a leaderboard score. Try it live in the **[Ropedia demos Space](https://huggingface.co/spaces/cy0307/ropedia-demos)**.
18
+
19
+ ## At a glance
20
 
21
  | | |
22
  |---|---|
23
+ | **Base model** | Trained **from scratch** (random initialization) — no pretrained base model. |
24
  | **Task** | differentiable image fitting |
25
+ | **Training objective** | **Photometric L2** image fitting through a multiresolution **hash-grid** encoding + a tiny MLP. |
26
  | **Track** | B · 3D & rendering |
27
  | **Notebook** | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ChaoYue0307/ropedia-academy/blob/main/notebooks/training/B_hashgrid_instngp.ipynb) |
28
 
 
34
  - **Split:** single image (overfit)
35
  - **Source:** scikit-image data.astronaut() (NASA, public domain)
36
 
37
+ ## Training config
38
 
39
+ Adam (lr 1e-2), 1500 steps; 8-level hash grid (2¹⁴ entries × 2 feats/level) + 2-layer MLP; 96×96.
40
+
41
+ ## Evaluation results
42
+
43
+ | metric | value | meaning |
44
+ |---|---|---|
45
+ | `psnr (final)` | 64.25 | |
46
 
47
 
48
  ![figure](figure.png)
49
 
50
+ ## Inference example
51
 
52
  ```python
53
  import torch
54
+ state = torch.load("hashgrid.pt", map_location="cpu") # this repo's checkpoint
55
+ # Rebuild the exact module from the lab notebook (see "Reproduce"), then:
56
+ # model.load_state_dict(state); model.eval()
57
+ ```
58
+
59
+ ## Limitations
60
+
61
+ **Educational scale.** Trained quickly on CPU on small or synthetic data, so absolute numbers are not competitive with production systems — the value is the *method* and a reproducible pipeline. No large-scale data, no hyperparameter sweep, and no multi-seed variance is reported. **Not for production use.**
62
+
63
+ Overfits a **single image**; hash collisions limit the highest-frequency detail; PSNR is generous on smooth images.
64
+
65
+ ## Failure cases
66
+
67
+ Hash collisions cause speckle at the finest levels; fitting succeeds on one image but says nothing about others.
68
+
69
+ ## Reproduce / train your own
70
+
71
+ **One click:** open the notebook in Colab → **Runtime → GPU → Run all**, then run its *Publish to the Hugging Face Hub* cell.
72
+
73
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ChaoYue0307/ropedia-academy/blob/main/notebooks/training/B_hashgrid_instngp.ipynb)
74
+
75
+ **From a shell:**
76
+ ```bash
77
+ git clone https://github.com/ChaoYue0307/ropedia-academy.git && cd ropedia-academy
78
+ pip install torch numpy matplotlib scikit-learn scikit-image gymnasium
79
+ jupyter nbconvert --to notebook --execute notebooks/training/B_hashgrid_instngp.ipynb --output run.ipynb
80
+ # optional: override training length, e.g. STEPS=2000 (or EPISODES=600) before running
81
  ```
82
 
83
  ## Files
 
87
  - `metrics.json`
88
 
89
 
90
+ ## License
91
+
92
+ Code & weights: **MIT** (this repository) — educational use encouraged.
93
+ Image: *astronaut* test image (NASA) — public domain, shipped with scikit-image.
94
+
95
+ ## Citation
96
+
97
+ If you use this model or the course materials, please cite:
98
+
99
+ ```bibtex
100
+ @misc{ropedia_academy,
101
+ title = {Ropedia Academy: an interactive course on embodied & spatial AI},
102
+ author = {Ropedia Academy},
103
+ year = {2026},
104
+ howpublished = {\url{https://chaoyue0307.github.io/ropedia-academy/}}
105
+ }
106
+ ```
107
+
108
+
109
+ **Method / original work:** Müller et al., *Instant Neural Graphics Primitives (Instant-NGP)*, SIGGRAPH 2022.
110
+
111
+ ## Related assets
112
 
113
+ - 🚀 **Live demos:** [https://huggingface.co/spaces/cy0307/ropedia-demos](https://huggingface.co/spaces/cy0307/ropedia-demos)
114
+ - 🤗 **All trained models + collection:** [https://huggingface.co/cy0307](https://huggingface.co/cy0307)
115
+ - 📚 **Course & all labs:** [https://chaoyue0307.github.io/ropedia-academy/](https://chaoyue0307.github.io/ropedia-academy/) · [Labs tab](https://chaoyue0307.github.io/ropedia-academy/labs)
116
+ - 💻 **Source / notebooks:** [github.com/ChaoYue0307/ropedia-academy](https://github.com/ChaoYue0307/ropedia-academy)
117
 
118
 
119
  ---
120
+ *Part of the [Ropedia Academy](https://chaoyue0307.github.io/ropedia-academy/) trained-model collection. Contributions & issues welcome on [GitHub](https://github.com/ChaoYue0307/ropedia-academy).*