shuinb commited on
Commit
cadc5d7
·
verified ·
1 Parent(s): ca736e6

Remove diagnostic, smoke, profiling and report-generation helpers

Browse files
codes/reconstruction/FILES.sha256 CHANGED
The diff for this file is too large to render. See raw diff
 
codes/reconstruction/REPRODUCE.txt CHANGED
@@ -1,215 +1,25 @@
1
- Download the entire codes/reconstruction directory. Linux and a CUDA GPU are required.
2
- Run: python relocate.py
3
- Create experiments/.venv using a compatible CUDA PyTorch environment, then install model requirements and the recorded dependencies.
4
- See environment.freeze.txt for the exact source environment and the notes below for nerfacc compatibility.
5
- Use reproduce.py eval JOB_ID --gpu 0 to evaluate the 100k checkpoint into a new output directory.
6
- Use reproduce.py train JOB_ID --gpu 0 for the recorded training command. Existing checkpoints are supplied; use a fresh copy for from-scratch training.
7
- Do not regenerate existing configs to inspect results.
8
- Only test_100000 results are included; all saved training checkpoints are retained.
9
-
10
- SOURCE ENVIRONMENT AND FIXES:
11
- # STB 9-scene training queue
12
-
13
- ## Independent TA 3-view retraining (2026-11-01)
14
-
15
- The completed from-scratch `transientangelo / physics_building3 / 3 views`
16
- retraining is merged into `run_20261025/transientangelo__physics_building3__3views/`.
17
- It disables AMP and uses the existing FP32 radiance MLP path, while retaining
18
- the original seed, splits, losses, batch, learning rates, schedule and full
19
- 100k/150k tests. The 81-job state and manifest now select this retraining.
20
- Old checkpoints, scores, and pre-merge state/manifest are retained under
21
- `run_20261025/archive_before_ta3_merge_20261103/`.
22
- See `run_20261025/retrain_ta_physics3_3views_20261101/RETRAIN.md` for diagnosis,
23
- and `run_20261025/MERGE_RETRAIN_20261103.md` for the directory migration.
24
- Check the consolidated run with:
25
-
26
- ```bash
27
- experiments/.venv/bin/python experiments/status.py --run-dir experiments/run_20261025
28
- ```
29
-
30
- ## Original 81-job run
31
-
32
- The latest `run_20261025/FULL_RESULTS_ALL_SCENES.md`,
33
- `run_20261025/RESULTS_100K_BY_VIEWS.md`, and `run_20261025/results_summary.{csv,md}`
34
- now use the completed FP32 retraining for TA / physics_building3 / 3 views at
35
- both 100k and 150k. The other 80 configurations are unchanged; old and new
36
- versions are not counted as separate configurations. The previous four reports
37
- are retained in `run_20261025/report_archive_before_ta3_retrain_20261101T101004-0500/`.
38
- Raw evaluation values are unchanged. The TA 3-view raw results and training
39
- configuration now reside in the main run, with the old version archived.
40
- The three report generators share `write_full_report.load_reporting_state()`
41
- to read the consolidated state; the CSV includes source directories and
42
- from-scratch retraining labels.
43
-
44
- English versions are available as `run_20261025/RESULTS_100K_BY_VIEWS_EN.md`,
45
- `run_20261025/FULL_RESULTS_ALL_SCENES_EN.md`, and
46
- `run_20261025/results_summary_EN.md`. They retain the same tables, values,
47
- frame filenames, and result sources as the Chinese reports. After regenerating
48
- the Chinese reports, refresh their English versions with:
49
-
50
- ```bash
51
- experiments/.venv/bin/python experiments/write_english_reports.py
52
- ```
53
-
54
- The standalone English per-test-frame report is
55
- `run_20261025/TEST_SAMPLES_100K_EN.md`, with full-precision data in
56
- `run_20261025/test_samples_100k.csv`. Both contain all 100k samples grouped by
57
- 3/5/10 training views and scene, reporting Image PSNR, Transient PSNR, SSIM,
58
- LPIPS, and Depth L1. Regenerate them directly from the selected result JSON with:
59
-
60
- ```bash
61
- experiments/.venv/bin/python experiments/write_test_samples.py
62
- ```
63
-
64
- The full run has 81 jobs: 3 methods × 9 scenes × 3/5/10 views, one seed (42).
65
- Each job trains for 150,000 steps, retains the 100,000 and 150,000 checkpoints,
66
- then runs the full supplied test split for each checkpoint with the existing
67
- 30-forward-pass common evaluation. The 50,000-step recovery checkpoint is also retained.
68
-
69
- ## Launch and monitoring
70
-
71
- The queue shares the remaining memory on physical GPUs 0 and 1 with existing
72
- workloads, one queue job per GPU. A TN job starts with at least 4,096 MiB free;
73
- TA test-only recovery needs 8,192 MiB after the bounded evaluation chunks
74
- described below. FWP and TA training require 9,216 MiB after the 2026-10-29
75
- initial/100k-resume native memory profiles with working expandable segments. Workers
76
- can select a later job that fits when earlier methods do not fit the available
77
- memory. It does not terminate
78
- existing workloads or use GPUs 2–5. Other workloads
79
- can change memory availability and compute throughput during a job.
80
-
81
- The queue sets both `PYTORCH_ALLOC_CONF` and `PYTORCH_CUDA_ALLOC_CONF` to
82
- `expandable_segments:True` for allocator compatibility with this installed
83
- PyTorch build. The effective CUDA allocator setting was checked at runtime.
84
- Only memory allocation and admission change; native training batch sizes,
85
- sample counts, optimizers, schedulers, and 150k targets do not change. See
86
- `run_20261025/MEMORY_RECOVERY_20261029.md` for measurements and limitations.
87
-
88
- ```bash
89
- experiments/.venv/bin/python experiments/build_queue.py
90
- setsid -f bash -c 'exec experiments/.venv/bin/python -u experiments/run_queue.py >> experiments/run_20261025/queue.log 2>&1 < /dev/null'
91
- tail -f experiments/run_20261025/queue.log
92
- experiments/.venv/bin/python experiments/status.py
93
- ```
94
-
95
- `run_20261025/manifest.json` lists every exact command and configuration.
96
- `run_20261025/state.json` records progress. Each job has its own `train.log`,
97
- `test_100000.log`, `test_150000.log`, `checkpoints/`, and
98
- `test_{step}/unified_metrics/metrics_aggregate.json` plus per-view metrics and
99
- floating-point scoring images. Full transient prediction arrays are not saved
100
- because of their storage cost; both checkpoints remain available for rerendering.
101
-
102
- The initial shared-GPU estimate is 5–10 days; see `run_20261025/ETA.md` for
103
- measurements, arithmetic, and uncertainty.
104
-
105
- On failure, new launches stop; an already active job is allowed to finish.
106
- Inspect the failed job and fix its cause before resuming. A completed score directory
107
- is never silently overwritten. An interrupted evaluation needs a fresh output directory.
108
- `--resume` only resumes pending jobs and refuses ambiguous running/failed states.
109
-
110
- After fixing a failed evaluation, restart it without repeating training:
111
-
112
- ```bash
113
- setsid -f bash -c 'exec experiments/.venv/bin/python -u experiments/run_queue.py --resume --retry-failed transientangelo__AI_floor2__3views >> experiments/run_20261025/queue.log 2>&1 < /dev/null'
114
- ```
115
-
116
- `--retry-failed` requires a stopped queue, exactly one named failed evaluation,
117
- and both requested checkpoints. Its partial output directory is renamed with a
118
- `_failed_<timestamp>` suffix, not deleted. Training, completed jobs, and previous
119
- logs remain intact. The job restarts at the failed test stage, then continues
120
- through the remaining tests and pending jobs.
121
-
122
- Queue jobs set `STB_METRICS_DEVICE=cpu`: native model rendering remains on GPU,
123
- while PSNR/SSIM/FP32 VGG LPIPS scoring runs in a CPU-only subprocess. This avoids
124
- competing with the renderer and other users for GPU memory. The selected metric
125
- device is recorded in each new evaluation's protocol JSON. Metric definitions,
126
- weights, normalization, masks, and 30-forward rendering are unchanged. Existing
127
- successful GPU-scored results are retained; CPU/GPU floating-point results may
128
- differ slightly.
129
-
130
- TN evaluation also honors `test_chunk_size`: each repetition generates the full
131
- native jittered ray set once, renders bounded ray slices, and accumulates their
132
- weighted histograms on CPU. This avoids full-frame CUDA network/convolution
133
- buffers on shared GPUs. All 30 repetitions, test frames, masks, calibration, and
134
- scoring rules are unchanged; training checkpoints are not modified by this fix.
135
-
136
- TA standalone evaluation caps the native ray chunk at 256 rays (or a smaller
137
- configured value), instead of letting the training configuration's 1,024-ray
138
- validation chunk inflate finite-difference geometry buffers on shared GPUs.
139
- `eval.py render --ray-chunk N` controls this evaluation-only upper bound. The
140
- actual chunk size is recorded in evaluation metadata. Training batch sizes,
141
- sample counts, all 30 repetitions, and scoring rules remain unchanged.
142
- The queue rechecks the 8,192 MiB TA test requirement at each test-stage boundary,
143
- because other users' allocations can change while training runs. If memory is
144
- insufficient, it waits instead of immediately launching a likely OOM test.
145
-
146
- ## Data and configuration decisions
147
-
148
- TA `physics_building3` 5/10-view recovery explicitly enables
149
- `model.texture.network_precision: float32` for the same packed radiance MLP
150
- weights. The original FP16 network overflowed on finite HDR inputs, eventually
151
- corrupting both 150k models and producing empty-grid zero predictions. The two
152
- jobs resume valid 100k full training state; other completed results are untouched.
153
- TA rejects non-finite training losses and refuses non-finite model checkpoints.
154
- See `run_20261025/TA_PHYSICS3_RECOVERY_20261031.md` for evidence and recovery details.
155
-
156
- - Original `Reconstruction/` files and supplied JSON splits are untouched.
157
- - `prepare_data.py` creates sparse NPZ caches for the FWP loader and renamed
158
- `transforms_train.json`/`transforms_test.json` copies; only extensions change,
159
- not frame IDs, ordering, camera metadata, or poses.
160
- - All three methods use the supplied `config/intrinsics.npy`, `offset.txt`,
161
- and, where the native method uses an IRF, `IRF_global.csv`.
162
- - The supplied IRF has 16 negative noise taps within its 101-tap response window.
163
- Direct convolution produced negative predicted counts and the unchanged common
164
- evaluator correctly rejected them. `build_queue.py` therefore creates
165
- `calibration/IRF_global_nonnegative.csv` by replacing negative **calibration taps**
166
- with zero; TN/TA use this same physical nonnegative response and their existing
167
- unit-sum normalization. Original calibration files, measurements, and predictions
168
- are not clipped or overwritten, and the scorer's nonnegative-count check remains.
169
- - The repository only supplies design_floor1/10-view training templates, not
170
- historical scene-by-scene training recipes. Other hyperparameters stay at those
171
- templates' defaults. Each scene's spatial AABB uses the supplied
172
- `sp_merged_map.ply` extrema, expanded by 5% or 0.5 m per axis, whichever is larger.
173
- Far-plane distance covers the full 672 × 750 ps measured temporal window
174
- (75.5477 m), rather than incorrectly truncating all scenes at the example's 28/33 m.
175
- These runs are not a claim of exact reproduction of historical paper settings.
176
- - The **existing** common V4 evaluator requires reference contracts and recorded
177
- calibration/file digests. `prepare_data.py` supplies that existing schema without
178
- removing or weakening its checks. It uses hardware-valid, calibrated full-count
179
- GT, the existing peak ≥100 mask, and a common ten-training-frame maximum for
180
- histogram and integrated-image scales across 3/5/10-view runs. No test frame is
181
- used to choose those scales; all original test poses remain intact.
182
- - Model environments use an isolated `--system-site-packages` venv based on the
183
- existing RTX 5090 environment (PyTorch 2.9.1/CUDA 12.8). Extra dependencies do not
184
- modify that shared environment. `torch-scatter` is compiled locally because the
185
- available wheel requires a newer system glibc.
186
- - TA retains its required nerfacc 0.3.3 in `ta_deps/` with a separate CUDA extension
187
- directory; TN/FWP retain nerfacc 0.5.3. Their ray marching APIs are not interchangeable.
188
- TA's legacy extension uses system GCC 9 instead of the inherited GCC 14 toolchain.
189
- - TA optimizer/scheduler configuration containers are converted to ordinary Python
190
- lists/dictionaries before saving, keeping checkpoints compatible with PyTorch's
191
- default weights-only loader without disabling its safety checks.
192
- - TA's standalone evaluator initializes the model's temporal and sampling metadata
193
- from the dataset before checking units, matching its native per-batch preprocessing.
194
- - Training checkpoints now count completed iterations rather than using the old
195
- zero-based save index, ensuring the final 150,000-step checkpoint is saved.
196
- TA's redundant automatic end-of-fit test is disabled only in queue configs;
197
- explicit tests run for both requested checkpoints.
198
- - TN's optimizer now uses `GradScaler.step()` and `update()`, rather than calling
199
- Adam directly on scaled gradients and bypassing overflow handling. Skipped
200
- overflow updates do not advance the scheduler or training-step counter. A
201
- non-finite forward loss stops training before corrupting another checkpoint.
202
- New checkpoint metadata saves the AMP scaler and optimizer gradient units;
203
- legacy Adam moments are rescaled on resume to match unscaled gradients.
204
- - TN's extra training-summary histogram dumps and FWP training previews are
205
- disabled in queue configs; their unused test datasets are not preloaded during
206
- training, reducing memory use. The complete 100k/150k tests remain enabled.
207
-
208
- `smoke/` contains short compatibility/timing runs, not full scientific results.
209
- Initial timings do not capture later occupancy pruning or progressive hash levels;
210
- the ETA must be treated as an estimate, with uncertainty from shared GPU compute.
211
-
212
- PORTABLE ENVIRONMENT SETUP:
213
- Use bash setup_environment.sh with Python 3.12 and CUDA 12.8 toolkit on PATH. Set CUDA_HOME to the local toolkit. GPU architecture and compiler must be supported by your CUDA installation. This setup script is provided from the recorded environment and has not been installed on a fresh GPU host. Do not install the older example requirements.txt from the models over this environment.
214
- The tinycudann source referenced by the original local file URL is bundled in dependencies/tiny-cuda-nn.tar.gz, including submodule contents. Original commit: 749dd70c5afc5a9dadb85e5652ed65d55e0ba187.
215
- TA uses bundled nerfacc 0.3.3 via PYTHONPATH; TN/FWP use installed nerfacc 0.5.3.
 
1
+ Download the entire codes/reconstruction directory. Linux and a CUDA GPU are required.
2
+ Run: python relocate.py
3
+ Create experiments/.venv using a compatible CUDA PyTorch environment, then install model requirements and the recorded dependencies.
4
+ See environment.freeze.txt for the exact source environment and the notes below for nerfacc compatibility.
5
+ Use reproduce.py eval JOB_ID --gpu 0 to evaluate the 100k checkpoint into a new output directory.
6
+ Use reproduce.py train JOB_ID --gpu 0 for the recorded training command. Existing checkpoints are supplied; use a fresh copy for from-scratch training.
7
+ Do not regenerate existing configs to inspect results.
8
+ Only test_100000 results are included; all saved training checkpoints are retained.
9
+
10
+ REPRODUCTION AND EVALUATION NOTES:
11
+ The package contains 81 official configurations: 3 models x 9 scenes x 3/5/10 training views, seed 42. Only 100k evaluation results are included; the original saved training checkpoints are retained.
12
+ The merged transientangelo / physics_building3 / 3-view configuration uses the completed from-scratch FP32 retraining. The 5/10-view configurations retain their recorded recovery settings. Use each job's actual train.ini or train.yaml and state.json commands.
13
+ Source template requirements/configurations can describe older environments and /work/runrong example paths. Use the supplied actual configurations, setup_environment.sh and requirements-reproduction.txt instead.
14
+ Original measurements and train/test splits are included. experiments/data contains the actual caches and adapted pose JSON. experiments/references includes the complete reference contracts, GT histograms and masks. experiments/calibration contains the processed IRF.
15
+ TN/TA use the supplied nonnegative IRF with unit-sum normalization. Reference scales use training frames only. All original test poses and the common 30-forward evaluation are retained.
16
+ The evaluation helper sets STB_METRICS_DEVICE=cpu; model rendering remains on GPU. CPU/GPU floating-point scoring can differ slightly. Evaluation output is written to a fresh directory.
17
+ The source environment used Python 3.12.12, PyTorch 2.9.1 with CUDA 12.8 and RTX 5090. TA uses bundled nerfacc 0.3.3, while TN/FWP use nerfacc 0.5.3. torch-scatter needs a compatible local source build. TA's legacy CUDA extension used system GCC 9; select a CUDA-compatible compiler via CC/CXX on your host.
18
+ Training repairs include completed-iteration checkpoint numbering, finite-loss/checkpoint checks, corrected TN GradScaler stepping and legacy Adam-moment rescaling on resume, and plain Python checkpoint configuration containers. TA initializes temporal/sampling metadata before unit checks; bounded evaluation ray chunks reduce memory requirements.
19
+ The original design_floor1/10-view templates were extended to the provided scenes using recorded AABBs and the full measured temporal window. These runs do not claim exact reproduction of historical paper settings.
20
+ The auxiliary diagnostic, smoke, profiling, single-view timing and report-generation scripts are excluded. Formal test_100000 results and test_samples_100k.csv are retained.
21
+
22
+ PORTABLE ENVIRONMENT SETUP:
23
+ Use bash setup_environment.sh with Python 3.12 and CUDA 12.8 toolkit on PATH. Set CUDA_HOME to the local toolkit. GPU architecture and compiler must be supported by your CUDA installation. This setup script is provided from the recorded environment and has not been installed on a fresh GPU host. Do not install the older example requirements.txt from the models over this environment.
24
+ The tinycudann source referenced by the original local file URL is bundled in dependencies/tiny-cuda-nn.tar.gz, including submodule contents. Original commit: 749dd70c5afc5a9dadb85e5652ed65d55e0ba187.
25
+ TA uses bundled nerfacc 0.3.3 via PYTHONPATH; TN/FWP use installed nerfacc 0.5.3.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
codes/reconstruction/experiments/diagnose_ta_dark_checkpoint.py DELETED
@@ -1,136 +0,0 @@
1
- import argparse
2
- import json
3
- import os
4
- from pathlib import Path
5
- import sys
6
-
7
-
8
- ROOT = Path(__file__).resolve().parents[1]
9
-
10
-
11
- def main():
12
- parser = argparse.ArgumentParser()
13
- parser.add_argument('--step', type=int, choices=[50000, 100000, 150000], required=True)
14
- parser.add_argument('--gpu', choices=['0', '1'], default='0')
15
- parser.add_argument('--output', type=Path, required=True)
16
- args = parser.parse_args()
17
- args.output.mkdir(parents=True, exist_ok=False)
18
- os.environ['CUDA_DEVICE_ORDER'] = 'PCI_BUS_ID'
19
- os.environ['CUDA_VISIBLE_DEVICES'] = args.gpu
20
- for key, value in dict(CC='/usr/bin/gcc', CXX='/usr/bin/g++', MAX_JOBS='4',
21
- CUDA_HOME='/home/donghongzhou/cuda-12.8', TORCH_CUDA_ARCH_LIST='12.0',
22
- TORCH_EXTENSIONS_DIR=str(ROOT / 'experiments/torch_extensions/ta'),
23
- OMP_NUM_THREADS='2', OPENBLAS_NUM_THREADS='2').items():
24
- os.environ.setdefault(key, value)
25
-
26
- sys.path.insert(0, str(ROOT / 'experiments/ta_deps'))
27
- sys.path.insert(0, str(ROOT / 'stb_minimal_20261017/transientangelo'))
28
- import numpy as np
29
- import torch
30
- import torch.nn.functional as functional
31
- import models.captured_neus as native
32
- from evaluation import renderer
33
- from evaluation.units import resolve_prediction_scale
34
- from systems.captured_neus import CapturedNeuSSystem
35
-
36
- work = ROOT / 'experiments/run_20261025/archive_before_ta3_merge_20261103/transientangelo__physics_building3__3views'
37
- report = dict(step=args.step, checkpoint=str(work / f'checkpoints/step{args.step}.ckpt'), runs={})
38
- context = {}
39
-
40
- class ProbeComplete(Exception):
41
- pass
42
-
43
- def statistics(value):
44
- value = value.detach().float()
45
- return dict(shape=list(value.shape), minimum=float(value.min()), maximum=float(value.max()),
46
- mean=float(value.mean()), nonfinite=int((~torch.isfinite(value)).sum()))
47
-
48
- original_geometry = None
49
- original_alpha = native.CapturedNeuSModel.get_alpha
50
- original_convolution = native.convolve_colour
51
-
52
- def inspect_alpha(model, sdf, normal, dirs, intervals):
53
- result = original_alpha(model, sdf, normal, dirs, intervals)
54
- context['sdf'] = statistics(sdf)
55
- context['normal_norm'] = statistics(torch.linalg.vector_norm(normal, dim=-1))
56
- context['alpha'] = statistics(result)
57
- context['saturated_positive_cdf_fraction'] = float((torch.sigmoid(sdf * model.variance.inv_s) == 1).float().mean())
58
- return result
59
-
60
- native.CapturedNeuSModel.get_alpha = inspect_alpha
61
-
62
- def float32_convolution(color, kernel, n_bins):
63
- with torch.autocast('cuda', enabled=False):
64
- result = functional.conv1d(color.float().transpose(1, 2).reshape(-1, 1, n_bins),
65
- kernel.weight.float(),
66
- kernel.bias.float() if kernel.bias is not None else None,
67
- stride=kernel.stride, padding=kernel.padding,
68
- dilation=kernel.dilation, groups=kernel.groups)
69
- return result.reshape(color.shape[0], 3, n_bins).transpose(1, 2)
70
-
71
- def setup(system):
72
- system.dataset = system.trainer.datamodule.test_dataloader().dataset
73
- system.model.n_bins = int(system.dataset.n_bins)
74
- system.model.exposure_time = float(system.dataset.exposure_time)
75
- system.model.near_plane = float(system.dataset.near)
76
- system.model.far_plane = float(system.dataset.far)
77
- nonlocal original_geometry
78
- original_geometry = system.model.geometry.forward
79
-
80
- def inspect_geometry(*arguments, **keywords):
81
- result = original_geometry(*arguments, **keywords)
82
- context['geometry_features'] = statistics(result[2])
83
- context['geometry_raw_gradient'] = statistics(result[1])
84
- return result
85
-
86
- system.model.geometry.forward = inspect_geometry
87
-
88
- def probe(system, batch, batch_idx):
89
- height, width = system.dataset.h, system.dataset.w
90
- rows = torch.linspace(0, height - 1, 8, device=system.device).long()
91
- columns = torch.linspace(0, width - 1, 8, device=system.device).long()
92
- indices = (rows[:, None] * width + columns[None, :]).flatten()
93
- rays = batch['rays_dict']['training_rays']['rays'][indices]
94
- scale, source = resolve_prediction_scale(system)
95
- saved = np.load(work / 'test_100000/unified_metrics/view0_inputs.npz')
96
- artifacts = dict(pixel_indices=indices.cpu().numpy(),
97
- saved_100k_image=saved['prediction'].reshape(-1, 3)[indices.cpu().numpy()])
98
- for name, texture_precision, convolution in [
99
- ('native', 'native', original_convolution),
100
- ('float32_texture', 'float32', original_convolution),
101
- ('float32_texture_and_irf', 'float32', float32_convolution),
102
- ]:
103
- context.clear()
104
- system.model.texture.network_precision = texture_precision
105
- native.convolve_colour = convolution
106
- out = system.model.forward_(rays, batch['laser_kernel'])
107
- histogram = out['rgb'].float() * scale
108
- intensity = histogram.sum(dim=1)
109
- peak_bin = histogram.mean(dim=-1).argmax(dim=-1)
110
- report['runs'][name] = dict(context, histogram=statistics(histogram),
111
- intensity=statistics(intensity), opacity=statistics(out['opacity']),
112
- peak_bin=statistics(peak_bin),
113
- fraction_first_bin=float((peak_bin == 1).float().mean()))
114
- artifacts[f'{name}_histogram'] = histogram.detach().cpu().numpy()
115
- artifacts[f'{name}_intensity'] = intensity.detach().cpu().numpy()
116
- report['training_scale'] = scale
117
- report['training_scale_source'] = source
118
- report['peak_allocated_mib'] = torch.cuda.max_memory_allocated() / 2**20
119
- np.savez_compressed(args.output / 'probe.npz', **artifacts)
120
- (args.output / 'diagnosis.json').write_text(json.dumps(report, indent=2) + '\n')
121
- print(json.dumps(report, indent=2), flush=True)
122
- raise ProbeComplete()
123
-
124
- CapturedNeuSSystem.on_test_start = setup
125
- CapturedNeuSSystem.test_step = probe
126
- sys.argv = ['renderer', '--config', str(work / 'train.yaml'), '--resume', report['checkpoint'],
127
- '--gpu', args.gpu, '--output', str(args.output / 'unused_evaluation')]
128
- try:
129
- renderer.main()
130
- except ProbeComplete:
131
- return
132
- raise RuntimeError('Test ended without running the diagnostic probe')
133
-
134
-
135
- if __name__ == '__main__':
136
- main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
codes/reconstruction/experiments/diagnose_transientangelo_nonfinite.py DELETED
@@ -1,188 +0,0 @@
1
- import argparse
2
- from datetime import datetime
3
- import json
4
- from pathlib import Path
5
- import runpy
6
- import sys
7
-
8
-
9
- ROOT = Path(__file__).resolve().parents[1]
10
-
11
-
12
- def worker(output, updates):
13
- import torch
14
- import torch.nn.functional as functional
15
-
16
- sys.path.insert(0, str(ROOT / 'stb_minimal_20261017/transientangelo'))
17
- import models.captured_neus as native
18
- from models.texture import VolumeRadiance
19
- from systems.captured_neus import CapturedNeuSSystem
20
-
21
- source = json.loads((output / 'source.json').read_text())
22
- context = dict(step=0 if source.get('from_scratch') else 100000, optimizer_updates=0)
23
- gradient_samples = []
24
-
25
- class DiagnosticComplete(Exception):
26
- pass
27
-
28
- def statistics(value):
29
- value = value.detach()
30
- finite = value[torch.isfinite(value)]
31
- return dict(shape=list(value.shape), dtype=str(value.dtype),
32
- nonfinite=int((~torch.isfinite(value)).sum()),
33
- minimum=float(finite.min()) if finite.numel() else None,
34
- maximum=float(finite.max()) if finite.numel() else None)
35
-
36
- def finish(stage, **details):
37
- report = dict(stage=stage, **context,
38
- peak_allocated_mib=torch.cuda.max_memory_allocated() / 2**20,
39
- peak_reserved_mib=torch.cuda.max_memory_reserved() / 2**20,
40
- gradient_samples=gradient_samples, **details)
41
- (output / 'diagnosis.json').write_text(json.dumps(report, indent=2) + '\n')
42
- print('DIAGNOSIS', json.dumps(report), flush=True)
43
- raise DiagnosticComplete()
44
-
45
- original_convolution = native.convolve_colour
46
-
47
- def inspect_convolution(color, kernel, n_bins):
48
- result = original_convolution(color, kernel, n_bins)
49
- if not torch.isfinite(result).all():
50
- with torch.autocast('cuda', enabled=False):
51
- reshaped = color.float().transpose(1, 2).reshape(-1, 1, n_bins)
52
- comparison = functional.conv1d(reshaped, kernel.weight.float(),
53
- kernel.bias.float() if kernel.bias is not None else None,
54
- stride=kernel.stride, padding=kernel.padding, dilation=kernel.dilation,
55
- groups=kernel.groups)
56
- torch.save(dict(color=color.detach().cpu(), weight=kernel.weight.detach().cpu(),
57
- bias=kernel.bias.detach().cpu() if kernel.bias is not None else None,
58
- n_bins=n_bins, padding=kernel.padding), output / 'convolution_reproducer.pt')
59
- finish('irf_convolution', input=statistics(color), output=statistics(result),
60
- float32_output=statistics(comparison), kernel=statistics(kernel.weight))
61
- return result
62
-
63
- native.convolve_colour = inspect_convolution
64
- original_texture = VolumeRadiance.forward
65
-
66
- def inspect_texture(texture, features, dirs, *arguments):
67
- result = original_texture(texture, features, dirs, *arguments)
68
- if not torch.isfinite(result).all():
69
- indices = torch.where(~torch.isfinite(result).all(dim=-1))[0][:8]
70
- torch.save(dict(features=features[indices].detach().cpu(),
71
- dirs=dirs[indices].detach().cpu(),
72
- arguments=[value[indices].detach().cpu() for value in arguments],
73
- output=result[indices].detach().cpu(),
74
- state_dict={key: value.detach().cpu() for key, value in texture.state_dict().items()},
75
- config=dict(texture.config)), output / 'texture_reproducer.pt')
76
- finish('texture', features=statistics(features), dirs=statistics(dirs),
77
- arguments=[statistics(value) for value in arguments], output=statistics(result))
78
- return result
79
-
80
- VolumeRadiance.forward = inspect_texture
81
- original_alpha = native.CapturedNeuSModel.get_alpha
82
-
83
- def inspect_alpha(model, *arguments):
84
- result = original_alpha(model, *arguments)
85
- if not torch.isfinite(result).all():
86
- finish('alpha', output=statistics(result),
87
- inputs=[statistics(value) for value in arguments],
88
- variance=statistics(model.variance.variance))
89
- return result
90
-
91
- native.CapturedNeuSModel.get_alpha = inspect_alpha
92
- original_training = CapturedNeuSSystem.training_step
93
-
94
- def inspect_training(system, *arguments):
95
- context['step'] = int(system.global_step)
96
- scaler = getattr(system.trainer.precision_plugin, 'scaler', None)
97
- context['amp_scale'] = float(scaler.get_scale()) if scaler is not None else None
98
- result = original_training(system, *arguments)
99
- if not torch.isfinite(result['loss']).all():
100
- finish('training_loss', loss=statistics(result['loss']))
101
- return result
102
-
103
- CapturedNeuSSystem.training_step = inspect_training
104
- original_optimizer = torch.optim.AdamW.step
105
-
106
- def inspect_optimizer(optimizer, *arguments, **keywords):
107
- result = original_optimizer(optimizer, *arguments, **keywords)
108
- sample = dict(step=context['step'], amp_scale=context.get('amp_scale'))
109
- for group in optimizer.param_groups:
110
- gradients = [parameter.grad for parameter in group['params']
111
- if parameter.grad is not None and parameter.grad.numel()]
112
- if any(not torch.isfinite(gradient).all() for gradient in gradients):
113
- finish('optimizer_gradient', parameter_group=group.get('name'))
114
- if gradients:
115
- sample[group.get('name', 'default')] = dict(
116
- max_abs=max(float(gradient.abs().max()) for gradient in gradients),
117
- nonzero=sum(int(torch.count_nonzero(gradient)) for gradient in gradients))
118
- if context['optimizer_updates'] < 5 or (context['optimizer_updates'] + 1) % 100 == 0:
119
- gradient_samples.append(sample)
120
- if any(not torch.isfinite(parameter).all() for group in optimizer.param_groups
121
- for parameter in group['params'] if parameter.numel()):
122
- finish('optimizer_parameters')
123
- context['optimizer_updates'] += 1
124
- if context['optimizer_updates'] % 100 == 0:
125
- print('DIAGNOSTIC_PROGRESS', json.dumps(context), flush=True)
126
- if context['optimizer_updates'] >= updates:
127
- finish('finite_training_window')
128
- return result
129
-
130
- torch.optim.AdamW.step = inspect_optimizer
131
- script = ROOT / 'stb_minimal_20261017/transientangelo/launch.py'
132
- sys.argv = [str(script), '--config', str(output / 'train.yaml'), '--train',
133
- '--gpu', str(source['gpu']), '--runs_dir', str(output / 'tensorboard')]
134
- if not source.get('from_scratch'):
135
- sys.argv.extend(['--resume', source['checkpoint']])
136
- try:
137
- runpy.run_path(str(script), run_name='__main__')
138
- except DiagnosticComplete:
139
- return
140
- raise RuntimeError('Native training ended before diagnosis completed')
141
-
142
-
143
- def main():
144
- parser = argparse.ArgumentParser()
145
- parser.add_argument('--views', type=int, choices=[3, 5, 10], default=5)
146
- parser.add_argument('--gpu', type=int, choices=[0, 1], default=0)
147
- parser.add_argument('--updates', type=int, default=6000)
148
- parser.add_argument('--float32-radiance', action='store_true')
149
- parser.add_argument('--full-precision', action='store_true')
150
- parser.add_argument('--from-scratch', action='store_true')
151
- parser.add_argument('--worker', type=Path)
152
- args = parser.parse_args()
153
- if args.updates <= 0:
154
- parser.error('--updates must be positive')
155
- if args.worker:
156
- worker(args.worker, args.updates)
157
- return
158
- import yaml
159
- from run_queue import execute
160
-
161
- state = json.loads((ROOT / 'experiments/run_20261025/state.json').read_text())
162
- job = dict(next(job for job in state['jobs']
163
- if job['id'] == f'transientangelo__physics_building3__{args.views}views'))
164
- checkpoint = Path(job['checkpoint']) / 'step100000.ckpt'
165
- output = ROOT / 'experiments/smoke' / f'ta_nonfinite_{args.views}views_{datetime.now():%Y%m%dT%H%M%S%f}'
166
- output.mkdir(parents=True)
167
- config = yaml.safe_load((Path(job['work']) / 'train.yaml').read_text())
168
- if args.float32_radiance or args.full_precision:
169
- config['model']['texture']['network_precision'] = 'float32'
170
- if args.full_precision:
171
- config['trainer']['precision'] = 32
172
- for key, directory in [('exp_dir', ''), ('save_dir', 'save'), ('ckpt_dir', 'checkpoints'),
173
- ('config_dir', 'config'), ('code_dir', 'code')]:
174
- config[key] = str(output / directory)
175
- (output / 'train.yaml').write_text(yaml.safe_dump(config, sort_keys=False))
176
- (output / 'source.json').write_text(json.dumps(dict(job_id=job['id'], gpu=args.gpu,
177
- checkpoint=None if args.from_scratch else str(checkpoint), native_max_steps=150000,
178
- updates=args.updates, from_scratch=args.from_scratch, full_precision=args.full_precision,
179
- float32_radiance=args.float32_radiance or args.full_precision), indent=2) + '\n')
180
- job['work'] = str(output)
181
- command = [state['python'], '-u', str(Path(__file__).resolve()), '--worker', str(output),
182
- '--updates', str(args.updates)]
183
- print('DIAGNOSTIC_OUTPUT', output, flush=True)
184
- raise SystemExit(execute(command, job, args.gpu, 'train'))
185
-
186
-
187
- if __name__ == '__main__':
188
- main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
codes/reconstruction/experiments/diagnose_trnerf_histogram.py DELETED
@@ -1,90 +0,0 @@
1
- import json
2
- from pathlib import Path
3
- import sys
4
-
5
- import numpy as np
6
- import torch
7
-
8
-
9
- ROOT = Path(__file__).resolve().parents[1]
10
- OUTPUT = ROOT / 'experiments/smoke/trnerf_material_diagnosis'
11
- OUTPUT.mkdir(parents=True, exist_ok=True)
12
- sys.path.insert(0, str(ROOT / 'stb_minimal_20261017/trnerf'))
13
-
14
- import misc.transient_volrend as volume
15
- import utils
16
- from evaluation.evaluator import EvaluationRun
17
- from evaluation.renderer import main
18
-
19
-
20
- def statistics(tensor):
21
- tensor = torch.as_tensor(tensor)
22
- return dict(shape=list(tensor.shape), dtype=str(tensor.dtype),
23
- minimum=float(tensor.min()), maximum=float(tensor.max()),
24
- negative=int((tensor < 0).sum()), nan=int(torch.isnan(tensor).sum()),
25
- infinite=int(torch.isinf(tensor).sum()))
26
-
27
-
28
- def fail(stage, **details):
29
- report = dict(stage=stage, **details)
30
- (OUTPUT / 'diagnosis.json').write_text(json.dumps(report, indent=2) + '\n')
31
- print(json.dumps(report), flush=True)
32
- raise SystemExit(2)
33
-
34
-
35
- original_convolve = volume.convolve_colour
36
-
37
-
38
- def inspect_convolution(color, kernel, n_bins):
39
- result = original_convolve(color, kernel, n_bins)
40
- bad = ~torch.isfinite(result) | (result < 0)
41
- if bad.any():
42
- rays = torch.unique(torch.where(bad)[0])[:3]
43
- torch.save(dict(input=color[rays].detach().cpu(), output=result[rays].detach().cpu(),
44
- weight=kernel.weight.detach().cpu(), bias=kernel.bias.detach().cpu()),
45
- OUTPUT / 'convolution_reproducer.pt')
46
- fail('irf_convolution', input=statistics(color), output=statistics(result),
47
- kernel=statistics(kernel.weight), bias=statistics(kernel.bias))
48
- return result
49
-
50
-
51
- volume.convolve_colour = inspect_convolution
52
- original_render = utils.rendering_transient_single_path
53
-
54
-
55
- def inspect_render(**arguments):
56
- original_query = arguments['rgb_sigma_fn']
57
-
58
- def query(*samples):
59
- colors, density = original_query(*samples)
60
- if not torch.isfinite(colors).all() or not torch.isfinite(density).all():
61
- fail('radiance_field', colors=statistics(colors), density=statistics(density))
62
- if arguments['args'].exp and not torch.isfinite(torch.exp(colors)).all():
63
- fail('radiance_exponential', colors=statistics(colors), density=statistics(density))
64
- return colors, density
65
-
66
- arguments['rgb_sigma_fn'] = query
67
- return original_render(**arguments)
68
-
69
-
70
- utils.rendering_transient_single_path = inspect_render
71
-
72
-
73
- def inspect_prediction(self, prediction, index):
74
- report = statistics(np.asarray(prediction))
75
- if report['negative'] or report['nan'] or report['infinite']:
76
- fail('averaged_histogram', index=index, prediction=report)
77
- print(json.dumps(dict(stage='first_histogram_valid', index=index, prediction=report)), flush=True)
78
- raise SystemExit(0)
79
-
80
-
81
- EvaluationRun.score = inspect_prediction
82
-
83
- checkpoint = Path(sys.argv[sys.argv.index('--checkpoint_dir') + 1])
84
- step = int(sys.argv[sys.argv.index('--step') + 1])
85
- parameters = torch.load(checkpoint / f'radiance_field_{step:04d}.pth', map_location='cpu', weights_only=True)
86
- invalid = [name for name, value in parameters.items() if not torch.isfinite(value).all()]
87
- print('Non-finite checkpoint parameters:', invalid, flush=True)
88
- if invalid:
89
- fail('checkpoint_parameters', invalid=invalid)
90
- main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
codes/reconstruction/experiments/one_view_eval.py DELETED
@@ -1,30 +0,0 @@
1
- import json
2
- from pathlib import Path
3
- import sys
4
- import time
5
-
6
-
7
- ROOT = Path(__file__).resolve().parents[1]
8
- method = sys.argv.pop(1)
9
- sys.path.insert(0, str(ROOT / 'stb_minimal_20261017' / method))
10
- from evaluation.evaluator import EvaluationRun
11
- from evaluation.renderer import main
12
-
13
-
14
- original_score = EvaluationRun.score
15
- started = time.monotonic()
16
-
17
-
18
- def first_view(self, prediction, index):
19
- scores = original_score(self, prediction, index)
20
- timing_path = ROOT / 'experiments/smoke' / method / 'timing.json'
21
- timing = json.loads(timing_path.read_text())
22
- timing['first_test_view_including_setup_seconds'] = time.monotonic() - started
23
- timing['test_note'] = 'One complete 30-forward-pass compatibility view only; deliberately no aggregate benchmark result.'
24
- timing_path.write_text(json.dumps(timing, indent=2))
25
- print(f'First test view passed in {time.monotonic()-started:.2f}s; ending partial compatibility smoke.', flush=True)
26
- raise SystemExit(0)
27
-
28
-
29
- EvaluationRun.score = first_view
30
- main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
codes/reconstruction/experiments/profile_training_memory.py DELETED
@@ -1,130 +0,0 @@
1
- import argparse
2
- from datetime import datetime
3
- import json
4
- from pathlib import Path
5
- import shutil
6
-
7
- import yaml
8
-
9
- from build_queue import ROOT, RUN, read_ini, save_ini
10
- from run_queue import execute
11
-
12
-
13
- parser = argparse.ArgumentParser()
14
- parser.add_argument('method', choices=['FlyingWithPhotons', 'transientangelo'])
15
- parser.add_argument('--gpu', type=int, required=True)
16
- parser.add_argument('--late', action='store_true')
17
- parser.add_argument('--updates', type=int, default=150)
18
- parser.add_argument('--allocator', choices=['expandable_segments', 'cudaMallocAsync'],
19
- default='expandable_segments')
20
- args = parser.parse_args()
21
- if args.updates <= 0:
22
- parser.error('--updates must be positive')
23
- state = json.loads((RUN / 'state.json').read_text())
24
- candidates = [job for job in state['jobs'] if job['method'] == args.method
25
- and job['status'] == ('completed' if args.late else 'pending')]
26
- job = dict(candidates[-1] if args.late else candidates[0])
27
- source_job = dict(job)
28
- phase = 'late' if args.late else 'initial'
29
- work = ROOT / 'experiments/smoke' / f'memory_{args.method}_{phase}_{datetime.now():%Y%m%dT%H%M%S%f}'
30
- work.mkdir(parents=True)
31
- job['work'] = str(work)
32
- command = list(job['train'])
33
- if args.method == 'FlyingWithPhotons':
34
- config = read_ini(Path(command[-1]))
35
- config['outpath'] = json.dumps(str(work))
36
- config_path = work / 'train.ini'
37
- save_ini(config_path, config)
38
- command[-1] = str(config_path)
39
- if args.late:
40
- checkpoint = work / 'checkpoints'
41
- checkpoint.mkdir()
42
- for prefix in ('radiance_field', 'occupancy_grid', 'optimizer', 'scheduler'):
43
- name = f'{prefix}_100000.pth'
44
- shutil.copy2(Path(source_job['checkpoint']) / name, checkpoint / name)
45
- import torch
46
- torch.save({'step': 100000}, checkpoint / 'variables.pth')
47
- else:
48
- config = yaml.safe_load(Path(command[4]).read_text())
49
- for key, name in [('exp_dir', ''), ('save_dir', 'save'), ('ckpt_dir', 'checkpoints'),
50
- ('config_dir', 'config'), ('code_dir', 'code')]:
51
- config[key] = str(work / name)
52
- config_path = work / 'train.yaml'
53
- config_path.write_text(yaml.safe_dump(config, sort_keys=False))
54
- command[4] = str(config_path)
55
- command[command.index('--runs_dir') + 1] = str(work / 'tensorboard')
56
- if args.late:
57
- command += ['--resume', str(Path(source_job['checkpoint']) / 'step100000.ckpt')]
58
-
59
- program = '''
60
- import functools
61
- import json
62
- import os
63
- from pathlib import Path
64
- import runpy
65
- import subprocess
66
- import sys
67
- import time
68
- import torch
69
-
70
- class ProfileComplete(Exception):
71
- pass
72
-
73
- output = Path(sys.argv.pop(1))
74
- updates = int(sys.argv.pop(1))
75
- script = sys.argv.pop(1)
76
- sys.argv[0] = script
77
- sys.path.insert(0, os.getcwd())
78
- torch.cuda.init()
79
- torch.cuda.reset_peak_memory_stats()
80
- print('ALLOCATOR_BACKEND', torch.cuda.memory.get_allocator_backend(), flush=True)
81
- completed = 0
82
- started = time.monotonic()
83
- report = {}
84
- def instrument(original):
85
- @functools.wraps(original)
86
- def step(optimizer, *arguments, **keywords):
87
- global completed
88
- result = original(optimizer, *arguments, **keywords)
89
- completed += 1
90
- if completed >= updates:
91
- torch.cuda.synchronize()
92
- report.update(optimizer_updates=completed,
93
- allocator_backend=torch.cuda.memory.get_allocator_backend(),
94
- peak_allocated_mib=torch.cuda.max_memory_allocated()/2**20,
95
- peak_reserved_mib=torch.cuda.max_memory_reserved()/2**20,
96
- elapsed_seconds=time.monotonic()-started)
97
- processes = subprocess.check_output(['nvidia-smi', '--id='+os.environ['CUDA_VISIBLE_DEVICES'],
98
- '--query-compute-apps=pid,used_memory',
99
- '--format=csv,noheader,nounits'], text=True)
100
- for line in processes.splitlines():
101
- process, memory = [int(field.strip()) for field in line.split(',')]
102
- if process == os.getpid():
103
- report['observed_process_mib'] = memory
104
- raise ProfileComplete()
105
- return result
106
- return step
107
- torch.optim.Adam.step = instrument(torch.optim.Adam.step)
108
- torch.optim.AdamW.step = instrument(torch.optim.AdamW.step)
109
- try:
110
- runpy.run_path(script, run_name='__main__')
111
- except ProfileComplete:
112
- report['note'] = 'Isolated native training-memory diagnostic, not a benchmark result.'
113
- (output/'memory_profile.json').write_text(json.dumps(report, indent=2)+'\\n')
114
- print('MEMORY_PROFILE', json.dumps(report), flush=True)
115
- else:
116
- raise RuntimeError('Training ended before the requested profile updates')
117
- '''
118
- allocator = ('backend:cudaMallocAsync' if args.allocator == 'cudaMallocAsync'
119
- else 'expandable_segments:True')
120
- program = ('import os\nos.environ["PYTORCH_ALLOC_CONF"] = '
121
- 'os.environ["PYTORCH_CUDA_ALLOC_CONF"] = ' + repr(allocator) + '\n' + program)
122
- command = [command[0], '-u', '-c', program, str(work), str(args.updates), *command[2:]]
123
- (work / 'source.json').write_text(json.dumps(dict(job_id=source_job['id'], phase=phase,
124
- source_checkpoint=source_job['checkpoint'] if args.late else None,
125
- native_max_steps=150000, gpu=args.gpu, allocator=allocator), indent=2) + '\n')
126
- print('Profile output:', work, flush=True)
127
- result = execute(command, job, args.gpu, 'train')
128
- if not result:
129
- print((work / 'memory_profile.json').read_text(), flush=True)
130
- raise SystemExit(result)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
codes/reconstruction/experiments/smoke_train.py DELETED
@@ -1,66 +0,0 @@
1
- import argparse
2
- import json
3
- from pathlib import Path
4
- import subprocess
5
- import time
6
-
7
- import yaml
8
-
9
- from build_queue import ROOT, RUN, read_ini, save_ini
10
- from run_queue import execute
11
-
12
-
13
- parser = argparse.ArgumentParser()
14
- parser.add_argument('method', choices=['trnerf', 'FlyingWithPhotons', 'transientangelo'])
15
- parser.add_argument('--gpu', type=int, default=0)
16
- parser.add_argument('--steps', type=int, default=150)
17
- args = parser.parse_args()
18
- manifest = json.loads((RUN / 'manifest.json').read_text())
19
- job = next(dict(job) for job in manifest['jobs'] if job['method'] == args.method and job['views'] == 3)
20
- work = ROOT / 'experiments/smoke' / args.method
21
- work.mkdir(parents=True, exist_ok=True)
22
- job.update(work=str(work), checkpoint=str(work / 'checkpoints'))
23
- if args.method == 'transientangelo':
24
- config = yaml.safe_load(Path(job['train'][4]).read_text())
25
- config.update(exp_dir=str(work), save_dir=str(work / 'save'), ckpt_dir=job['checkpoint'],
26
- config_dir=str(work / 'config'), code_dir=str(work / 'code'))
27
- config['checkpoint']['every_n_train_steps'] = 50
28
- config['trainer'].update(max_steps=args.steps, log_every_n_steps=10)
29
- config_path = work / 'train.yaml'
30
- config_path.write_text(yaml.safe_dump(config, sort_keys=False))
31
- command = list(job['train'])
32
- command[4] = str(config_path)
33
- command[-1] = str(work / 'tensorboard')
34
- else:
35
- config = read_ini(Path(job['train'][-1]))
36
- config.update(outpath=json.dumps(str(work)), max_steps=str(args.steps))
37
- config['steps_til_checkpoint' if args.method == 'trnerf' else 'steps_till_checkpoint'] = '50'
38
- config_path = work / 'train.ini'
39
- save_ini(config_path, config)
40
- command = list(job['train'])
41
- command[-1] = str(config_path)
42
- started = time.monotonic()
43
- result = execute(command, job, args.gpu, 'train')
44
- print(f'{args.method} exited {result}, total elapsed {time.monotonic()-started:.2f}s', flush=True)
45
- if result:
46
- raise SystemExit(result)
47
- from tensorboard.backend.event_processing.event_accumulator import EventAccumulator
48
- tags = 'train/loss_rgb' if args.method == 'transientangelo' else 'Loss/train'
49
- events = []
50
- for event_path in work.rglob('events.out.tfevents.*'):
51
- accumulator = EventAccumulator(str(event_path), size_guidance={'scalars': 0})
52
- accumulator.Reload()
53
- if tags in accumulator.Tags()['scalars']:
54
- events.extend(accumulator.Scalars(tags))
55
- events = sorted(events, key=lambda event: event.step)
56
- events = [event for event in events if event.step >= 30]
57
- if len(events) >= 2:
58
- intervals = [(right.wall_time-left.wall_time, right.step-left.step)
59
- for left, right in zip(events, events[1:])
60
- if not any(left.step <= checkpoint < right.step for checkpoint in range(50, args.steps+1, 50))]
61
- seconds_per_step = sum(interval[0] for interval in intervals)/sum(interval[1] for interval in intervals)
62
- profile = dict(method=args.method, steps=args.steps, seconds_per_step=seconds_per_step,
63
- total_seconds=time.monotonic()-started, gpu=args.gpu,
64
- note='Short initial training under existing GPU load; later occupancy/active hash levels can change throughput.')
65
- (work / 'timing.json').write_text(json.dumps(profile, indent=2))
66
- print(json.dumps(profile), flush=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
codes/reconstruction/experiments/summarize_results.py DELETED
@@ -1,96 +0,0 @@
1
- import csv
2
- import json
3
- from datetime import datetime
4
- from pathlib import Path
5
- from statistics import mean
6
- from zoneinfo import ZoneInfo
7
-
8
- from write_full_report import REPORT_SOURCE_NOTE, load_reporting_state
9
-
10
-
11
- RUN = Path(__file__).resolve().parent / 'run_20261025'
12
- METHODS = ['trnerf', 'FlyingWithPhotons', 'transientangelo']
13
- METRICS = ['histogram_psnr', 'image_psnr', 'ssim', 'lpips', 'depth_l1_m']
14
-
15
-
16
- def table(rows, columns):
17
- lines = ['| ' + ' | '.join(columns) + ' |', '| ' + ' | '.join(['---'] * len(columns)) + ' |']
18
- for row in rows:
19
- values = [f'{row[column]:.4f}' if isinstance(row[column], float) else str(row[column]) for column in columns]
20
- lines.append('| ' + ' | '.join(values) + ' |')
21
- return '\n'.join(lines)
22
-
23
-
24
- def main():
25
- state = load_reporting_state()
26
- rows = []
27
- for job in state['jobs']:
28
- for step in (100000, 150000):
29
- folder = Path(job['work']) / f'test_{step}' / 'unified_metrics'
30
- aggregate = folder / 'metrics_aggregate.json'
31
- if not aggregate.is_file():
32
- continue
33
- progress = json.loads((folder / 'progress.json').read_text())
34
- if not progress.get('complete') or progress['completed_views'] != job['test_frames']:
35
- continue
36
- recovered_from = job.get('recovered_from_step')
37
- rows.append(dict(job_id=job['id'], method=job['method'], scene=job['scene'],
38
- views=job['views'], step=step, test_frames=job['test_frames'],
39
- recovered_from_step=recovered_from if recovered_from is not None and step > recovered_from else '',
40
- retrained_from_scratch=bool(job.get('retrained_from_scratch')),
41
- source_directory=str(folder),
42
- **json.loads(aggregate.read_text())))
43
- metadata = ['job_id', 'method', 'scene', 'views', 'step', 'test_frames', 'recovered_from_step',
44
- 'retrained_from_scratch', 'source_directory']
45
- columns = metadata + sorted({key for row in rows for key in row} - set(metadata))
46
- with (RUN / 'results_summary.csv').open('w', newline='') as output:
47
- writer = csv.DictWriter(output, fieldnames=columns)
48
- writer.writeheader()
49
- writer.writerows(rows)
50
- complete = {(row['job_id'], row['step']) for row in rows}
51
- scenes = sorted({job['scene'] for job in state['jobs']})
52
- full_scenes = [scene for scene in scenes if all((job['id'], step) in complete
53
- for job in state['jobs'] if job['scene'] == scene for step in (100000, 150000))]
54
- averages = []
55
- for method in METHODS:
56
- matched = [row for row in rows if row['method'] == method and row['step'] == 150000 and row['scene'] in full_scenes]
57
- if matched:
58
- averages.append(dict(method=method, configurations=len(matched),
59
- **{metric: mean(row[metric] for row in matched) for metric in METRICS}))
60
- changes = []
61
- for method in METHODS:
62
- pairs = []
63
- for job in state['jobs']:
64
- matched = {row['step']: row for row in rows if row['job_id'] == job['id'] and row['method'] == method}
65
- if 100000 in matched and 150000 in matched:
66
- pairs.append(matched)
67
- if pairs:
68
- changes.append(dict(method=method, configurations=len(pairs),
69
- image_psnr_delta=mean(pair[150000]['image_psnr'] - pair[100000]['image_psnr'] for pair in pairs),
70
- lpips_delta=mean(pair[150000]['lpips'] - pair[100000]['lpips'] for pair in pairs),
71
- image_psnr_improved=sum(pair[150000]['image_psnr'] > pair[100000]['image_psnr'] for pair in pairs)))
72
- report = ['# Available complete test results',
73
- 'Generated: ' + datetime.now(ZoneInfo('America/New_York')).isoformat(timespec='seconds'),
74
- f'{len(rows)} complete checkpoint evaluations. Partial/failed evaluations are excluded.',
75
- 'Single seed (42); ' + ('all scheduled checkpoint evaluations are complete.'
76
- if len(rows) == 2 * len(state['jobs']) else 'these are interim results; scheduled evaluations remain incomplete.'),
77
- 'Recovered training continuations are marked in the CSV recovered_from_step column; see the affected job RECOVERY.md.',
78
- REPORT_SOURCE_NOTE,
79
- 'PSNR/SSIM: higher is better. LPIPS/depth L1 (metres): lower is better.',
80
- '## Matched 150k averages',
81
- 'Only fully evaluated scenes: ' + ', '.join(full_scenes) + '. Each scene/view configuration has equal weight.',
82
- table(averages, ['method', 'configurations'] + METRICS),
83
- '## Paired 150k minus 100k changes',
84
- 'Only complete checkpoint pairs within each method; configuration counts can differ between methods.',
85
- table(changes, ['method', 'configurations', 'image_psnr_delta', 'lpips_delta', 'image_psnr_improved'])]
86
- for step in (150000, 100000):
87
- report.extend([f'## All complete {step}-step results',
88
- table([row for row in rows if row['step'] == step], ['scene', 'views', 'method'] + METRICS)])
89
- (RUN / 'results_summary.md').write_text('\n\n'.join(report) + '\n')
90
- print('\n\n'.join(report[:12]))
91
- print('CSV:', RUN / 'results_summary.csv')
92
- print('Report:', RUN / 'results_summary.md')
93
-
94
-
95
- if __name__ == '__main__':
96
- main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
codes/reconstruction/experiments/write_100k_report.py DELETED
@@ -1,97 +0,0 @@
1
- from datetime import datetime
2
- from statistics import mean
3
- from zoneinfo import ZoneInfo
4
-
5
- from write_full_report import METHODS, NAMES, REPORT_SOURCE_NOTE, RUN, load_reporting_state, load_results, text
6
-
7
-
8
- OUTPUT = RUN / 'RESULTS_100K_BY_VIEWS.md'
9
- METRICS = ['image_psnr', 'histogram_psnr', 'ssim', 'lpips', 'depth_l1_m']
10
- LABELS = dict(method='模型', view='测试序号', frame='原始测试帧',
11
- image_psnr='Image PSNR (dB) ↑', histogram_psnr='Transient PSNR (dB) ↑',
12
- ssim='SSIM ↑', lpips='LPIPS ↓', depth_l1_m='Depth L1 (m) ↓')
13
-
14
-
15
- def table(rows, identifiers):
16
- columns = identifiers + METRICS
17
- lines = ['| ' + ' | '.join(LABELS[key] for key in columns) + ' |',
18
- '| ' + ' | '.join('---' for key in columns) + ' |']
19
- lines.extend('| ' + ' | '.join(text(row[key]) for key in columns) + ' |' for row in rows)
20
- return '\n'.join(lines)
21
-
22
-
23
- def main():
24
- state = load_reporting_state()
25
- records, canonical = load_results(state, steps=(100000,))
26
- scenes = sorted(canonical)
27
- sample_count = sum(len(row['samples']) for row in records)
28
- generated = datetime.now(ZoneInfo('America/New_York')).isoformat(timespec='seconds')
29
- report = ['# SP-TransientBench:100k 五项指标,按训练 views 分组',
30
- f'生成时间:{generated}(America/New_York)。',
31
- '快速导航:[3 views](#views-3) · [5 views](#views-5) · [10 views](#views-10)。',
32
- '## 范围与统计口径',
33
- f'- 仅统计正式 **100,000 步 checkpoint**,共 {len(records)} 组完整评测:'
34
- f'{len(scenes)} 个场景 × 3 个模型 × 3/5/10 views。\n'
35
- f'- 全部逐测试帧数据共 **{sample_count} 条**,覆盖 '
36
- f'{sum(len(frames) for frames in canonical.values())} 个不同的场景内测试帧;'
37
- '每个测试帧在三个模型、三种训练 views 下分别列出,不抽样或去重。\n'
38
- '- 列出五项指标:**Image PSNR、Transient PSNR、SSIM、LPIPS、Depth L1**。'
39
- 'Image PSNR 对应 `image_psnr`,Transient PSNR 对应 `histogram_psnr`,两者单位均为 dB;'
40
- 'Depth L1 单位为米。\n'
41
- '- Transient PSNR 在原始计数域的瞬态直方图上计算,采用场景训练数据确定的固定峰值,'
42
- '统计有效像素的全部 bins/通道,不做显示域 gamma 或上界裁剪。\n'
43
- '- Image PSNR/SSIM/LPIPS 使用原评测的显示域图像:固定场景尺度 D,'
44
- '预测为 clip(I/D,0,1)^(1/2.2),GT 为 (I/D)^(1/2.2)、不做上界裁剪;'
45
- 'Depth L1 来自瞬态直方图峰值深度。未改变任何指标定义。\n'
46
- '- 单场景均值是该配置全部测试帧的算术平均;各 views 的总体均值对 9 个场景等权,'
47
- '不按场景测试帧数重新加权。\n'
48
- '- 测试序号从 0 开始;逐帧表按测试序号、模型排列,方便对比同一帧。'
49
- '完整保留原始帧文件名和所有低分结果。\n'
50
- '- 仅 seed=42;数值显示为 12 位有效数字。所有 100k 结果取自其正式目录,'
51
- '不使用其他 checkpoint 或归档结果替换。']
52
- report.extend(['## 本次结果来源更新', REPORT_SOURCE_NOTE,
53
- '本报告仍只列 100k,使用重训的 100k 而不是 150k。该组全黑退化已消除,但 test 0/1 仍过亮,'
54
- 'Transient PSNR 分别约 -5.39/-1.21 dB;所有 test 均保留并参与均值。'
55
- '对比详见 `experiments/run_20261025/retrain_ta_physics3_3views_20261101/RESULTS.md`。'])
56
- for views in (3, 5, 10):
57
- selected = [row for row in records if row['views'] == views]
58
- report.extend([f'<a id="views-{views}"></a>', f'## {views} views · 100k',
59
- f'本组:{len(selected)} 组评测,'
60
- f'{sum(len(row["samples"]) for row in selected)} 条逐测试帧数据。',
61
- '### 本 views 总体均值(9 场景等权)'])
62
- averages = []
63
- for method in METHODS:
64
- matched = [row for row in selected if row['method_id'] == method]
65
- averages.append(dict(method=NAMES[method],
66
- **{key: mean(row[key] for row in matched) for key in METRICS}))
67
- report.append(table(averages, ['method']))
68
- for scene in scenes:
69
- scene_records = [next(row for row in selected
70
- if row['scene'] == scene and row['method_id'] == method)
71
- for method in METHODS]
72
- report.extend([f'### {scene} · {views} views · 100k',
73
- f'完整测试帧数:{len(canonical[scene])};三个模型均逐帧列出。',
74
- '#### 场景均值', table(scene_records, ['method']),
75
- '#### 每个 test 的指标'])
76
- samples = []
77
- for index in range(len(canonical[scene])):
78
- for row in scene_records:
79
- sample = row['samples'][index]
80
- samples.append(dict(method=row['method'], view=sample['view'], frame=sample['frame'],
81
- **{key: sample[key] for key in METRICS}))
82
- report.append(table(samples, ['view', 'frame', 'method']))
83
- report.append('原始逐帧 JSON:\n' + '\n'.join(
84
- f'- `{row["source"]}/metrics_per_view.json`' for row in scene_records))
85
- report.extend(['## 数据来源与复核',
86
- f'- 以上逐帧表共 {sample_count} 行正式测试记录,每行五项指标,未包含其他 checkpoint。\n'
87
- '- 已核对各组完整标记、测试帧数、帧序号与原始文件名;同场景测试帧在模型和 views 间一致。\n'
88
- '- 场景均值直接对应正式 `metrics_aggregate.json`,并与逐帧均值核对;所有展示指标均为有限数。\n'
89
- '- 此版本为独立精简报告,不覆盖此前全部指标的完整报告。\n'
90
- '- 重生成命令:`experiments/.venv/bin/python experiments/write_100k_report.py`。'])
91
- OUTPUT.write_text('\n\n'.join(report) + '\n')
92
- print(f'Report: {OUTPUT}')
93
- print(f'Evaluations: {len(records)}; sample rows: {sample_count}; metric cells: {sample_count * len(METRICS)}')
94
-
95
-
96
- if __name__ == '__main__':
97
- main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
codes/reconstruction/experiments/write_english_reports.py DELETED
@@ -1,175 +0,0 @@
1
- import re
2
-
3
- from write_full_report import DESCRIPTIONS, REPORT_SOURCE_NOTE, RUN
4
-
5
-
6
- CELLS = {
7
- '模型': 'Method', '步数': 'Steps', '训练 views': 'Training views',
8
- '配置数': 'Configurations', '测试序号': 'Test index',
9
- '原始帧文件': 'Original frame file', '原始测试帧': 'Original test frame',
10
- '有效像素数': 'Valid pixels', '恢复标记': 'Recovery / retraining',
11
- '场景': 'Scene', '测试帧数': 'Test frames', '训练配置数': 'Training configurations',
12
- '完整评测数': 'Complete evaluations', '逐帧记录数': 'Per-frame records',
13
- '原始字段': 'Raw field', '表格缩写': 'Table abbreviation',
14
- '单位/方向': 'Unit / direction', '定义': 'Definition', '版本': 'Version',
15
- '训练样本序号': 'Training sample index', 'Depth误差降低 (%)': 'Depth error reduction (%)',
16
- 'LPIPS降低 (%)': 'LPIPS reduction (%)',
17
- '100k续训;GradScaler修复': 'Resumed from 100k; GradScaler fixed',
18
- '100k续训;辐射MLP FP32': 'Resumed from 100k; FP32 radiance MLP',
19
- '从头重训;关闭AMP/辐射MLP FP32': 'Retrained from scratch; AMP disabled / FP32 radiance MLP',
20
- '归档无效全零输出': 'Archived invalid all-zero output',
21
- '当前恢复结果': 'Current recovered result',
22
- 'dB,越高越好': 'dB; higher is better',
23
- '无量纲,越高越好': 'Dimensionless; higher is better',
24
- '无量纲,越低越好': 'Dimensionless; lower is better',
25
- 'm,越低越好': 'm; lower is better',
26
- 'counts²,越低越好': 'counts²; lower is better',
27
- 'counts,越低越好': 'counts; lower is better',
28
- '百分数,诊断项': 'Percentage; diagnostic', '倍数,诊断项': 'Ratio; diagnostic',
29
- }
30
- DEFINITIONS = {
31
- 'histogram_psnr': 'Raw count-domain histogram PSNR, using a fixed peak determined from scene training data; not integrated-image PSNR.',
32
- 'image_psnr': 'Display-domain integrated-image PSNR, with a fixed peak of 1 and the display transform described below.',
33
- 'ssim': 'Display-domain RGB SSIM with a uniform 7×7 window and sample covariance, using only fully valid windows.',
34
- 'lpips': 'Display-domain VGG 0.1 LPIPS in FP32; common invalid regions are set to black and inputs are mapped to [-1,1].',
35
- 'depth_l1_m': 'Mean absolute error against GT of the depth at the channel-averaged histogram peak; depth=bin_index×c×dt/2.',
36
- 'transient_iou': 'sum(min(pred,GT))/sum(max(pred,GT)) over valid histogram counts; not binary geometric IoU.',
37
- 'linear_psnr': 'Linear integrated-count PSNR: -10log10(mean(((Pred-GT)/D)^2)), without upper clipping or gamma.',
38
- 'histogram_mse_counts': 'Histogram mean squared error over all bins/channels at valid pixels.',
39
- 'histogram_mae_counts': 'Histogram mean absolute error over all bins/channels at valid pixels.',
40
- 'prediction_above_scale_percent': 'Percentage of valid pixels whose predicted integrated intensity exceeds D in any RGB channel; not an optimization objective.',
41
- 'reference_above_scale_percent': 'Percentage of valid pixels whose GT integrated intensity exceeds D in any RGB channel.',
42
- 'max_prediction_over_scale': 'Maximum predicted integrated intensity/D over valid pixels in one test frame; configuration tables average these frame-level values.',
43
- 'max_reference_over_scale': 'Maximum GT integrated intensity/D over valid pixels in one test frame; configuration tables average these frame-level values.',
44
- }
45
- CELLS.update({DESCRIPTIONS[key][1]: definition for key, definition in DEFINITIONS.items()})
46
-
47
- EXACT = {
48
- '# SP-TransientBench:100k 五项指标,按训练 views 分组': '# SP-TransientBench: Five Metrics at 100k, Grouped by Training View Count',
49
- '# SP-TransientBench 九场景完整实验指标报告': '# SP-TransientBench: Complete Experimental Metrics Across Nine Scenes',
50
- '## 范围与统计口径': '## Scope and Aggregation',
51
- '## 本次结果来源更新': '## Updated Result Sources',
52
- '## 数据来源与复核': '## Sources and Verification',
53
- '## 1. 范围与完整性': '## 1. Scope and Completeness',
54
- '## 2. 统计与评测口径': '## 2. Aggregation and Evaluation Protocol',
55
- '## 3. 全局结果(配置等权)': '## 3. Overall Results (Equal Configuration Weights)',
56
- '## 4. 分 views 总体结果': '## 4. Overall Results by Training View Count',
57
- '## 5. 分场景完整结果与全部样本': '## 5. Complete Scene-Level Results and All Samples',
58
- '## 6. 恢复、归档及结果解释边界': '## 6. Recovery, Archives, and Interpretation Limits',
59
- '## 7. 复核与文件来源': '## 7. Verification and Source Files',
60
- '### 2.1 全部 13 项指标': '### 2.1 All 13 Metrics',
61
- '### 3.1 150k 与 100k 的配对变化': '### 3.1 Paired Changes from 100k to 150k',
62
- '### 3.2 总体观察': '### 3.2 Overall Observations',
63
- '### 本 views 总体均值(9 场景等权)': '### Overall Means for This View Count (Nine Scenes, Equal Weights)',
64
- '### 已归档的两组 TA 无效 150k 与当前恢复结果(仅用于问��追踪,不参与主表均值)': '### Two Archived Invalid TA 150k Evaluations vs. Recovered Results (Issue Tracking Only; Excluded from Main Means)',
65
- '#### 场景均值': '#### Scene Means',
66
- '#### 每个 test 的指标': '#### Metrics for Every Test Frame',
67
- '#### 全部正式测试样本:逐模型 × views × checkpoint': '#### All Official Test Samples: Method × View Count × Checkpoint',
68
- '#### 全部配置的聚合指标(18 行,无筛选)': '#### Aggregate Metrics for All Configurations (18 Rows, No Filtering)',
69
- '#### 原始划分的全部训练样本文件名': '#### All Training Sample Filenames from the Original Splits',
70
- '#### 模型均值(该场景 3/5/10 views 等权)': '#### Method Means (Equal Weights for 3/5/10 Views Within This Scene)',
71
- '原始逐帧 JSON:': 'Original per-frame JSON files:',
72
- '原始聚合/协议:同目录 `metrics_aggregate.json`、`evaluation_protocol.json`。': 'Original aggregate/protocol: `metrics_aggregate.json` and `evaluation_protocol.json` in the same directory.',
73
- '差值表中列标题箭头仍表示原始指标方向,表内数值统一为 150k−100k。': 'Arrows in the difference-table headers retain the direction of the original metric; every value is 150k−100k.',
74
- '这里的“所有样本”指所有训练划分文件名,以及所有正式测试帧的逐配置评测记录;不将每个像素/bin展开为 Markdown 行,不将归档失败尝试混入正式实验。': '“All samples” means every training-split filename and every official test-frame evaluation for each configuration. Individual pixels/bins are not expanded into Markdown rows, and archived failed attempts are not mixed into the official results.',
75
- '逐样本元信息同时保留 `view`、原始 `frame`、`valid_pixels`、`prediction_scale`、`prediction_gamma`。测试序号从 0 开始;两张逐样本表按相同测试序号一一对应。': 'Per-sample metadata retain `view`, the original `frame`, `valid_pixels`, `prediction_scale`, and `prediction_gamma`. Test indices are zero-based; the two per-sample tables align by the same test index.',
76
- '上表 PSNR 差值单位为 dB,不将 dB 做百分比解释;误差降低百分比为 (100k误差−150k误差)/|100k误差|×100,负值表示误差增大。': 'PSNR differences above are in dB, not percentages. Error reduction is (error at 100k−error at 150k)/|error at 100k|×100; negative values indicate increased error.',
77
- REPORT_SOURCE_NOTE: 'The 100k and 150k results for TransientAngelo / physics_building3 / 3 views have both been replaced by the corresponding checkpoints from the independent FP32 retraining on 2026-11-01. Sources for the other 80 configurations are unchanged. The report still contains 81 configurations: old and new runs are not counted as additional samples, and checkpoints are not selected by test scores. The retrained results are now merged into `experiments/run_20261025/transientangelo__physics_building3__3views/`. Original raw results are retained under `experiments/run_20261025/archive_before_ta3_merge_20261103/transientangelo__physics_building3__3views/`; previous summaries remain archived under `experiments/run_20261025/report_archive_before_ta3_retrain_*/`.',
78
- }
79
-
80
- PARAGRAPHS = {
81
- '- Image PSNR/SSIM/LPIPS 使用': '- Image PSNR/SSIM/LPIPS use the original display-domain images with a fixed scene scale D: prediction=clip(I/D,0,1)^(1/2.2), GT=(I/D)^(1/2.2), with no upper clipping of GT. Depth L1 uses the transient histogram peak. Metric definitions are unchanged.',
82
- '- Transient PSNR 在': '- Transient PSNR is computed on raw count-domain transient histograms, using a fixed peak determined from scene training data. It covers all bins/channels at valid pixels, without display-domain gamma or upper clipping.',
83
- '- 仅 seed=42': '- Only seed=42 is used. Values are displayed with 12 significant digits. All 100k results come from their official directories, without substitution from other checkpoint steps or archived results.',
84
- '- 仅统计正式': '- Only official **100,000-step checkpoints** are included: 81 complete evaluations across 9 scenes × 3 methods × 3/5/10 training views.',
85
- '- 以上逐帧表共': '- The per-frame tables contain 1422 official test records, each with five metrics; no other checkpoint steps are included.',
86
- '- 全部逐测试帧数据共': '- All per-test-frame data comprise **1422 records**, covering 158 distinct scene-local test frames. Every test frame is listed separately for each of the three methods and three training view counts, without subsampling or deduplication.',
87
- '- 列出五项指标': '- Five metrics are reported: **Image PSNR, Transient PSNR, SSIM, LPIPS, and Depth L1**. Image PSNR is `image_psnr`; Transient PSNR is `histogram_psnr`. Both are in dB; Depth L1 is in metres.',
88
- '- 单场景均值': '- A scene/configuration mean is the arithmetic mean across all its test frames. Overall means for each training view count weight the 9 scenes equally, rather than weighting scenes by their test-frame counts.',
89
- '- 场景均值直接对应': '- Scene means correspond directly to the official `metrics_aggregate.json` and have been checked against per-frame means. All displayed metrics are finite.',
90
- '- 已核对各组': '- Completion flags, test-frame counts, frame indices, and original filenames have been checked. Scene-local test frames are identical across methods and view counts.',
91
- '- 此版本为独立精简报告': '- This is a separate compact report; it does not overwrite the complete report containing all metrics.',
92
- '- 测试序号从': '- Test indices are zero-based. Per-frame tables are ordered by test index and method for direct comparison. Original filenames and all low-scoring results are retained.',
93
- '- 重生成命令': '- Regenerate the source with `experiments/.venv/bin/python experiments/write_100k_report.py`, then generate English reports with `experiments/.venv/bin/python experiments/write_english_reports.py`.',
94
- '本报告仍只列': 'This report includes only 100k: the retrained 100k checkpoint is used, not 150k. The near-black collapse has been eliminated, but test frames 0/1 remain overbright, with Transient PSNR of approximately -5.39/-1.21 dB. All test frames are retained in the means. See `experiments/run_20261025/retrain_ta_physics3_3views_20261101/RESULTS.md` for the comparison.',
95
- '- 150k−100k 差值': '- Changes are computed within each matched configuration as 150k−100k and then averaged. Whether a positive or negative change is favorable depends on the metric direction.',
96
- '- MaxPred/D、MaxGT/D': '- In per-frame tables, MaxPred/D and MaxGT/D are maxima within that frame. Configuration/method means average these frame-level maxima; they are not scene-wide global maxima. Changes in percentage diagnostics are in percentage points.',
97
- '- TransientAngelo physics_building3 / 3 views': '- TransientAngelo physics_building3 / 3 views: independently retrained from scratch with AMP disabled and an FP32 radiance MLP. The original seed, splits, learning rates, batch, losses, and 150k schedule are unchanged. Both new 100k/150k evaluations are included.',
98
- '- TransientAngelo physics_building3 / 5': '- TransientAngelo physics_building3 / 5,10 views: the original 150k parameters contained NaNs and the occupancy grids were empty, producing all-zero predictions. Training resumed from the complete valid 100k state; only radiance-MLP execution changed to FP32, retaining the same parameter layout. Other training settings and scoring definitions are unchanged.',
99
- '- TransientNeRF material_building': '- TransientNeRF material_building / 10 views: incorrect GradScaler usage was fixed, and training resumed from valid 100k model/optimizer states. Legacy Adam moments were converted from the original gradient-scaling units. The valid 100k evaluation is retained.',
100
- '- physics_building3 仍': '- Large depth/count-domain errors can remain on physics_building3. Fixing numerical collapse does not establish that all reconstruction-quality problems are solved. Good display-domain image scores do not guarantee good histogram or depth scores.',
101
- '- 上述恢复均': '- The resumed runs above reset seed=42. Original checkpoints did not store complete random-generator states, so these are not bitwise replays of the original training trajectories.',
102
- '- 仅一个 seed': '- Only one seed (42) is available. No cross-seed standard deviations, confidence intervals, or significance claims are reported. Per-frame variation does not constitute independent repeated experiments.',
103
- '- 全局结果按': '- Overall means weight the 27 scene×view-count configurations equally. Within a scene, method means weight its 3 view-count configurations equally. Scenes are not reweighted by test-frame counts, and mean PSNR is not replaced by PSNR computed from pooled MSE.',
104
- '- 固定参考掩码': '- The fixed reference mask requires offset≤10, calibrated GT peak≥100, and positive signal. Pixels are not selected by prediction quality.',
105
- '- 图像主指标采用': '- Primary image metrics use a fixed scene scale D: displayed prediction=clip(I/D,0,1)^(1/2.2), GT=(I/D)^(1/2.2), without upper clipping of GT. Thus I-PSNR/SSIM/LPIPS are display-domain metrics and must not be confused with Linear-PSNR, which has no display transform.',
106
- '- 已核对:每组完整标记': '- Checked: completion flags, expected frame counts, unique indices, protocol frame order, and consistency of scene-local filenames and valid-pixel counts across methods/configurations.',
107
- '- 已核对:逐帧与聚合': '- Checked: per-frame and aggregate metrics are finite, and each aggregate matches the arithmetic mean of its per-frame values.',
108
- '- 数值展示使用': '- Values are displayed with 12 significant digits. Raw JSON retains the original floating-point precision; this report does not modify evaluation files.',
109
- '- 数据来源仅为': '- Sources are the current local official results, original split caches, and existing recovery notes. No numerical results from external papers are used.',
110
- '- 本实验采用': '- The experiment adapts the current repository templates to the nine scenes and uses unified evaluation. It does not claim exact scene-by-scene reproduction of the original paper settings.',
111
- '- 本报告主表只使用': '- Main tables use only the current valid results in official directories. Archived failed/all-zero outputs are not extra methods, seeds, or independent samples.',
112
- '- 本报告由': '- The source report is generated by `experiments/write_full_report.py`; regenerate it with `experiments/.venv/bin/python experiments/write_full_report.py`, then generate English reports with `experiments/.venv/bin/python experiments/write_english_reports.py`.',
113
- '- 正式聚合结果': '- Official aggregate results: 162 evaluations, each containing all 13 metrics.',
114
- '- 正式逐测试帧记录': '- Official per-test-frame records: 2844, each displaying all 13 metrics and all 5 sample metadata fields.',
115
- '- 每个纳入统计的训练版本': '- Both 100k and 150k are retained for every included training version. Checkpoints are not selected by test scores, and low-scoring samples are not dropped.',
116
- '- 每个配置的指标': '- Configuration metrics are arithmetic means across the complete test split. Every raw aggregate has been checked against its per-frame mean.',
117
- '- 直方图为': '- Histograms have 672 bins at 750 ps/bin. Each method retains its native sampling strategy; every official test frame uses 30 repeated forward passes.',
118
- '- 计数域直方图': '- Training encodings are inverted before count-domain histogram scoring, without upper clipping. Non-finite or negative raw predictions must not be silently cleaned.',
119
- '本报告覆盖': 'This report covers 9 scenes, 3 methods, 3/5/10 training views, and 100k/150k checkpoints: 81 training configurations, 162 complete evaluations, and 2844 per-test-frame records. There are 158 distinct scene-local test frames. The same frame is listed separately for each method, view count, and checkpoint, without deduplication or subsampling.',
120
- }
121
-
122
- PATTERNS = [
123
- (r'生成时间:(.+)(America/New_York)。', lambda match: f'Source report generated: {match[1]} (America/New_York).'),
124
- (r'快速导航:(.+)。', lambda match: f'Quick navigation: {match[1]}.'),
125
- (r'场景快速导航:(.+)', lambda match: f'Scene navigation: {match[1]}'),
126
- (r'队列状态:(.+)。最后完成时间:(.+)。', lambda match: f'Queue status: {match[1]}. Latest completion: {match[2]}.'),
127
- (r'### (\d+) views:每模型每 checkpoint 为 9 场景均值', lambda match: f'### {match[1]} Views: Nine-Scene Mean for Each Method and Checkpoint'),
128
- (r'### 场景:(.+)', lambda match: f'### Scene: {match[1]}'),
129
- (r'##### (.+) · (\d+) views · (\d+) 步', lambda match: f'##### {match[1]} · {match[2]} views · {match[3]} steps'),
130
- (r'配置 ID:`(.+)`;恢复标记:(.+)。', lambda match: f'Configuration ID: `{match[1]}`; recovery/retraining: {CELLS.get(match[2], match[2])}.'),
131
- (r'原始逐帧结果:`(.+)`。', lambda match: f'Original per-frame results: `{match[1]}`.'),
132
- (r'测试帧数:(\d+);配置数:(\d+);checkpoint 评测数:(\d+);逐帧评测记录数:(\d+)。', lambda match: f'Test frames: {match[1]}; configurations: {match[2]}; checkpoint evaluations: {match[3]}; per-frame evaluation records: {match[4]}.'),
133
- (r'固定直方图峰值:(.+) counts;固定图像尺度 D:(.+) counts;协议:(.+)。', lambda match: f'Fixed histogram peak: {match[1]} counts; fixed image scale D: {match[2]} counts; protocols: {match[3]}.'),
134
- (r'本组:(\d+) 组评测,(\d+) 条逐测试帧数据。', lambda match: f'This group: {match[1]} evaluations and {match[2]} per-test-frame records.'),
135
- (r'完整测试帧数:(\d+);三个模型均逐帧列出。', lambda match: f'Complete test split: {match[1]} frames; every frame is listed for all three methods.'),
136
- (r'源划分缓存:`(.+)`。帧名仅换为 NPZ 缓存扩展名;训练集合间存在的重叠不作去重。', lambda match: f'Source split cache: `{match[1]}`. Only the filename extension changes to the NPZ cache extension; overlaps between training sets are not deduplicated.'),
137
- (r'- `(.+)` 的恢复说明:`(.+)`。', lambda match: f'- Recovery notes for `{match[1]}`: `{match[2]}`.'),
138
- (r'归档:`(.+)`。', lambda match: f'Archive: `{match[1]}`.'),
139
- (r'- 150k 配置等权平均的 (.+) 最优模型为 (.+):(.+)。', lambda match: f'- For the configuration-weighted mean at 150k, the best method for {match[1]} is {match[2]}: {match[3]}.'),
140
- (r'该场景 150k 的模型均值:Image PSNR 最优为 (.+) ((.+) dB),Depth L1 最优为 (.+)((.+) m)。这是结果描述,不用于选择或替换 checkpoint。', lambda match: f'For this scene\'s method means at 150k, the best Image PSNR is achieved by {match[1]} ({match[2]} dB), and the best Depth L1 by {match[3]} ({match[4]} m). This describes the results; it is not used to select or replace checkpoints.'),
141
- (r'更新后,TransientAngelo physics_building3 / 3 views / 100k 的 Image PSNR 为 (.+) dB,Depth L1 为 (.+) m;(.+)', lambda match: f'After the update, TransientAngelo physics_building3 / 3 views / 100k has Image PSNR {match[1]} dB and Depth L1 {match[2]} m. The old near-black version is excluded from the current means, but its raw results and previous reports remain available. New 100k test frames 0/1 remain overbright, with Transient PSNR approximately -5.39/-1.21 dB. All five primary metrics at retrained 150k are worse than at retrained 100k. These low-scoring samples are retained, and checkpoint steps are not changed according to test scores. Retraining results and comparisons: `experiments/run_20261025/retrain_ta_physics3_3views_20261101/RESULTS.md`.'),
142
- ]
143
-
144
-
145
- def translate_line(line):
146
- if line.startswith('| '):
147
- cells = [cell.strip() for cell in line.strip('|').split('|')]
148
- return '| ' + ' | '.join(CELLS.get(cell, cell) for cell in cells) + ' |'
149
- if line in EXACT:
150
- return EXACT[line]
151
- for pattern, replacement in PATTERNS:
152
- match = re.fullmatch(pattern, line)
153
- if match:
154
- return replacement(match)
155
- for prefix, translation in PARAGRAPHS.items():
156
- if line.startswith(prefix):
157
- return translation
158
- return line
159
-
160
-
161
- def main():
162
- for filename in ['RESULTS_100K_BY_VIEWS.md', 'FULL_RESULTS_ALL_SCENES.md', 'results_summary.md']:
163
- source = RUN / filename
164
- original = source.read_text()
165
- translated = '\n'.join(translate_line(line) for line in original.splitlines()) + '\n'
166
- untranslated = [line for line in translated.splitlines() if re.search(r'[\u4e00-\u9fff]', line)]
167
- if untranslated:
168
- raise ValueError(f'Untranslated content in {filename}: {untranslated[:3]}')
169
- output = source.with_name(source.stem + '_EN.md')
170
- output.write_text(translated)
171
- print('English report:', output)
172
-
173
-
174
- if __name__ == '__main__':
175
- main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
codes/reconstruction/experiments/write_full_report.py DELETED
@@ -1,310 +0,0 @@
1
- import json
2
- import math
3
- from collections import Counter
4
- from datetime import datetime
5
- from pathlib import Path
6
- from statistics import mean
7
- from zoneinfo import ZoneInfo
8
-
9
-
10
- ROOT = Path(__file__).resolve().parents[1]
11
- RUN = ROOT / 'experiments/run_20261025'
12
- OUTPUT = RUN / 'FULL_RESULTS_ALL_SCENES.md'
13
- RETRAIN_JOB = 'transientangelo__physics_building3__3views'
14
- REPORT_SOURCE_NOTE = (
15
- '本次已将 TransientAngelo / physics_building3 / 3 views 的 100k 和 150k,'
16
- '同时替换为 2026-11-01 独立 FP32 重训的同一步数结果;其余 80 个配置来源不变。'
17
- '仍统计 81 个配置,不把新旧训练当成额外样本,也不按测试分数挑选 checkpoint。'
18
- '重训结果现已合并到 `experiments/run_20261025/transientangelo__physics_building3__3views/`;'
19
- '旧原始结果保存在 `experiments/run_20261025/archive_before_ta3_merge_20261103/transientangelo__physics_building3__3views/`,'
20
- '替换前汇总仍在 `experiments/run_20261025/report_archive_before_ta3_retrain_*/`。')
21
- METHODS = ['trnerf', 'FlyingWithPhotons', 'transientangelo']
22
- NAMES = dict(trnerf='TransientNeRF', FlyingWithPhotons='FlyingWithPhotons', transientangelo='TransientAngelo')
23
- PRIMARY = ['histogram_psnr', 'image_psnr', 'ssim', 'lpips', 'depth_l1_m', 'transient_iou', 'linear_psnr']
24
- AUXILIARY = ['histogram_mse_counts', 'histogram_mae_counts', 'prediction_above_scale_percent',
25
- 'reference_above_scale_percent', 'max_prediction_over_scale', 'max_reference_over_scale']
26
- METRICS = PRIMARY + AUXILIARY
27
- HIGHER = {'histogram_psnr', 'image_psnr', 'ssim', 'transient_iou', 'linear_psnr'}
28
- LOWER = {'lpips', 'depth_l1_m', 'histogram_mse_counts', 'histogram_mae_counts'}
29
- LABELS = dict(histogram_psnr='H-PSNR ↑', image_psnr='I-PSNR ↑', ssim='SSIM ↑', lpips='LPIPS ↓',
30
- depth_l1_m='Depth-L1 ↓', transient_iou='T-IoU ↑', linear_psnr='Linear-PSNR ↑',
31
- histogram_mse_counts='H-MSE ↓', histogram_mae_counts='H-MAE ↓',
32
- prediction_above_scale_percent='Pred>D (%)', reference_above_scale_percent='GT>D (%)',
33
- max_prediction_over_scale='MaxPred/D', max_reference_over_scale='MaxGT/D',
34
- method='模型', step='步数', views='训练 views', count='配置数', view='测试序号',
35
- frame='原始帧文件', valid_pixels='有效像素数', prediction_scale='Prediction scale',
36
- prediction_gamma='Prediction gamma', recovered='恢复标记', scene='场景',
37
- test_frames='测试帧数', configurations='训练配置数', evaluations='完整评测数',
38
- sample_records='逐帧记录数', field='原始字段', short='表格缩写', unit='单位/方向',
39
- definition='定义', version='版本', index='训练样本序号',
40
- image_psnr_delta='ΔI-PSNR (dB)', depth_error_reduction_percent='Depth误差降低 (%)',
41
- lpips_reduction_percent='LPIPS降低 (%)')
42
- DESCRIPTIONS = {
43
- 'histogram_psnr': ('dB,越高越好', '原始计数域直方图 PSNR,使用场景训练数据确定的固定峰值;不是积分图像 PSNR。'),
44
- 'image_psnr': ('dB,越高越好', '显示域积分图像 PSNR;固定峰值 1,使用下述显示变换。'),
45
- 'ssim': ('无量纲,越高越好', '显示域 RGB SSIM,7×7 均匀窗口、样本协方差,仅完整有效窗口。'),
46
- 'lpips': ('无量纲,越低越好', '显示域 VGG 0.1 LPIPS,FP32;共同无效区域置黑,输入映射到 [-1,1]。'),
47
- 'depth_l1_m': ('m,越低越好', '通道平均直方图峰值对应深度与 GT 的绝对误差均值,深度=bin_index×c×dt/2。'),
48
- 'transient_iou': ('无量纲,越高越好', '有效直方图计数的 sum(min(pred,GT))/sum(max(pred,GT)),不是二值几何 IoU。'),
49
- 'linear_psnr': ('dB,越高越好', '线性积分计数域 PSNR:-10log10(mean(((Pred-GT)/D)^2)),不做上界裁剪或 gamma。'),
50
- 'histogram_mse_counts': ('counts²,越低越好', '有效像素全部 bins/通道上的直方图均方误差。'),
51
- 'histogram_mae_counts': ('counts,越低越好', '有效像素全部 bins/通道上的直方图平均绝对误差。'),
52
- 'prediction_above_scale_percent': ('百分数,诊断项', '有效像素中任意 RGB 通道的预测积分强度超过 D 的比例;不是优化目标。'),
53
- 'reference_above_scale_percent': ('百分数,诊断项', '有效像素中任意 RGB 通道的 GT 积分强度超过 D 的比例。'),
54
- 'max_prediction_over_scale': ('倍数,诊断项', '单测试帧有效像素预测积分强度最大值/D;配置表中为该帧级指标的平均值。'),
55
- 'max_reference_over_scale': ('倍数,诊断项', '单测试帧有效像素 GT 积分强度最大值/D;配置表中为该帧级指标的平均值。'),
56
- }
57
-
58
-
59
- def text(value):
60
- if isinstance(value, float):
61
- return format(value, '.12g')
62
- return str(value).replace('|', '\\|').replace('\n', ' ')
63
-
64
-
65
- def table(rows, columns):
66
- result = ['| ' + ' | '.join(LABELS.get(key, key) for key in columns) + ' |',
67
- '| ' + ' | '.join('---' for key in columns) + ' |']
68
- result.extend('| ' + ' | '.join(text(row[key]) for key in columns) + ' |' for row in rows)
69
- return '\n'.join(result)
70
-
71
-
72
- def metric_tables(rows, identifiers):
73
- return [table(rows, identifiers + PRIMARY), table(rows, identifiers + AUXILIARY)]
74
-
75
-
76
- def averages(records, steps=(100000, 150000), views=None):
77
- rows = []
78
- for step in steps:
79
- for method in METHODS:
80
- selected = [row for row in records if row['step'] == step and row['method_id'] == method
81
- and (views is None or row['views'] == views)]
82
- rows.append(dict(method=NAMES[method], step=step, count=len(selected),
83
- **{key: mean(row[key] for row in selected) for key in METRICS}))
84
- return rows
85
-
86
-
87
- def load_reporting_state():
88
- state = json.loads((RUN / 'state.json').read_text())
89
- retrained = [job for job in state['jobs'] if job['id'] == RETRAIN_JOB]
90
- if len(retrained) != 1:
91
- raise ValueError('Expected exactly one merged retraining configuration')
92
- if retrained[0]['status'] != 'completed' or not retrained[0].get('retrained_from_scratch'):
93
- raise ValueError('The merged retraining must be completed and explicitly labeled')
94
- return state
95
-
96
-
97
- def recovered_label(job, step):
98
- if job.get('retrained_from_scratch'):
99
- return '从头重训;关闭AMP/辐射MLP FP32'
100
- if job.get('recovered_from_step') is None or step <= job['recovered_from_step']:
101
- return '—'
102
- if job['method'] == 'transientangelo':
103
- return '100k续训;辐射MLP FP32'
104
- return '100k续训;GradScaler修复'
105
-
106
-
107
- def load_results(state, steps=(100000, 150000)):
108
- records = []
109
- canonical = {}
110
- for job in state['jobs']:
111
- for step in steps:
112
- folder = Path(job['work']) / f'test_{step}' / 'unified_metrics'
113
- aggregate = json.loads((folder / 'metrics_aggregate.json').read_text())
114
- samples = json.loads((folder / 'metrics_per_view.json').read_text())
115
- progress = json.loads((folder / 'progress.json').read_text())
116
- protocol = json.loads((folder / 'evaluation_protocol.json').read_text())
117
- if (not progress['complete'] or len(samples) != job['test_frames']
118
- or progress['completed_views'] != job['test_frames']
119
- or progress['expected_views'] != job['test_frames']):
120
- raise ValueError(f'Incomplete result: {job["id"]}, step {step}')
121
- if set(aggregate) != set(METRICS):
122
- raise ValueError(f'Unexpected metric fields: {folder}')
123
- samples = sorted(samples, key=lambda sample: sample['view'])
124
- if [sample['view'] for sample in samples] != list(range(job['test_frames'])):
125
- raise ValueError(f'Duplicate/missing sample indices: {folder}')
126
- frames = [(sample['frame'], sample['valid_pixels']) for sample in samples]
127
- if len({frame for frame, pixels in frames}) != job['test_frames']:
128
- raise ValueError(f'Duplicate test frames: {folder}')
129
- if frames != canonical.setdefault(job['scene'], frames):
130
- raise ValueError(f'Canonical frames or masks differ: {folder}')
131
- if [sample['frame'] for sample in samples] != protocol['frames']:
132
- raise ValueError(f'Protocol frame order differs: {folder}')
133
- for key in METRICS:
134
- if not math.isfinite(aggregate[key]) or not all(math.isfinite(sample[key]) for sample in samples):
135
- raise ValueError(f'Non-finite metric: {folder}, {key}')
136
- if not math.isclose(aggregate[key], mean(sample[key] for sample in samples), rel_tol=1e-10, abs_tol=1e-10):
137
- raise ValueError(f'Aggregate differs from per-frame mean: {folder}, {key}')
138
- records.append(dict(job=job, method_id=job['method'], method=NAMES[job['method']],
139
- scene=job['scene'], views=job['views'], step=step,
140
- recovered=recovered_label(job, step), samples=samples, protocol=protocol,
141
- source=str(folder.relative_to(ROOT)), **aggregate))
142
- return records, canonical
143
-
144
-
145
- def main():
146
- state = load_reporting_state()
147
- records, canonical = load_results(state)
148
- scenes = sorted(canonical)
149
- sample_count = sum(len(record['samples']) for record in records)
150
- generated = datetime.now(ZoneInfo('America/New_York')).isoformat(timespec='seconds')
151
- report = ['# SP-TransientBench 九场景完整实验指标报告', f'生成时间:{generated}(America/New_York)。',
152
- '场景快速导航:' + ' · '.join(f'[{scene}](#scene-{scene.lower()})' for scene in scenes),
153
- '## 1. 范围与完整性',
154
- f'本报告覆盖 {len(scenes)} 个场景、3 个模型、3/5/10 views、100k/150k 两个 checkpoint:'
155
- f'共 {len(state["jobs"])} 个训练配置、{len(records)} 组完整评测、{sample_count} 条���测试帧记录。'
156
- f'涉及 {sum(len(frames) for frames in canonical.values())} 个不同的场景内测试帧;'
157
- '同一帧在不同模型、views 和 checkpoint 下分别记录,不作去重或抽样。',
158
- '这里的“所有样本”指所有训练划分文件名,以及所有正式测试帧的逐配置评测记录;'
159
- '不将每个像素/bin展开为 Markdown 行,不将归档失败尝试混入正式实验。',
160
- REPORT_SOURCE_NOTE,
161
- f'队列状态:{dict(Counter(job["status"] for job in state["jobs"]))}。'
162
- f'最后完成时间:{max(job["finished"] for job in state["jobs"])}。',
163
- table([dict(scene=scene, test_frames=len(canonical[scene]), configurations=9,
164
- evaluations=sum(row['scene'] == scene for row in records),
165
- sample_records=sum(len(row['samples']) for row in records if row['scene'] == scene))
166
- for scene in scenes], ['scene', 'test_frames', 'configurations', 'evaluations', 'sample_records']),
167
- '## 2. 统计与评测口径',
168
- '- 每个纳入统计的训练版本都保留 100k 和 150k,不按测试集选择更好的 checkpoint,也不丢弃低分样本。\n'
169
- '- 每个配置的指标为完整测试帧的算术平均;本报告已逐项核对原始 aggregate 与逐帧均值。\n'
170
- '- 全局结果按 27 个场景×views 配置等权平均;单场景模型均值按 3 个 views 配置等权平均。'
171
- '不把不同测试帧数的场景按帧数重新加权;也不将平均 PSNR 改成 pooled-MSE PSNR。\n'
172
- '- 150k−100k 差值为同一配置配对后取平均;正值/负值的优劣由指标方向决定。\n'
173
- '- 仅一个 seed=42,不报告跨种子标准差、置信区间或显著性结论;逐帧差异不等同于独立重复实验。\n'
174
- '- 直方图为 672 bins、750 ps/bin;各模型保留其原生采样方式,每个正式测试帧做 30 次前向重复。\n'
175
- '- 固定参考掩码:offset≤10、校准 GT 峰值≥100 且存在正信号;不按预测质量筛选像素。\n'
176
- '- 计数域直方图先反解训练编码,不做上界裁剪;原始非有限/负预测不得被悄悄清理。\n'
177
- '- 图像主指标采用固定场景尺度 D:预测显示值为 clip(I/D,0,1)^(1/2.2),'
178
- 'GT 为 (I/D)^(1/2.2)、不做上界裁剪。因此 I-PSNR/SSIM/LPIPS 是显示域指标,'
179
- '不能与不做显示变换的 Linear-PSNR 混为一谈。\n'
180
- '- MaxPred/D、MaxGT/D 在逐帧表中是该帧最大值;配置/模型均值表是这些帧级最大值的平均,'
181
- '不是整场景的全局最大值。百分数诊断项的差值单位为百分点。\n'
182
- '- 数值展示使用 12 位有效数字;原始 JSON 保留原始浮点精度,本报告不修改原始评测文件。',
183
- '### 2.1 全部 13 项指标',
184
- table([dict(field=f'`{key}`', short=LABELS[key], unit=DESCRIPTIONS[key][0], definition=DESCRIPTIONS[key][1])
185
- for key in METRICS], ['field', 'short', 'unit', 'definition']),
186
- '逐样本元信息同时保留 `view`、原始 `frame`、`valid_pixels`、`prediction_scale`、`prediction_gamma`。'
187
- '测试序号从 0 开始;两张逐样本表按相同测试序号一一对应。',
188
- '## 3. 全局结果(配置等权)']
189
- overall = averages(records)
190
- report.extend(metric_tables(overall, ['method', 'step', 'count']))
191
- report.append('### 3.1 150k 与 100k 的配对变化')
192
- changes = []
193
- for method in METHODS:
194
- before = next(row for row in overall if row['method'] == NAMES[method] and row['step'] == 100000)
195
- after = next(row for row in overall if row['method'] == NAMES[method] and row['step'] == 150000)
196
- changes.append(dict(method=NAMES[method], **{key: after[key] - before[key] for key in METRICS}))
197
- report.extend(metric_tables(changes, ['method']))
198
- report.append('差值表中列标题箭头仍表示原始指标方向,表内数值统一为 150k−100k。')
199
- report.append('### 3.2 总体观察')
200
- latest = [row for row in overall if row['step'] == 150000]
201
- for key in PRIMARY:
202
- winner = (max if key in HIGHER else min)(latest, key=lambda row: row[key])
203
- report.append(f'- 150k 配置等权平均的 {LABELS[key]} 最优模型为 {winner["method"]}:{text(winner[key])}。')
204
- relative = []
205
- for method in METHODS:
206
- before = next(row for row in overall if row['method'] == NAMES[method] and row['step'] == 100000)
207
- after = next(row for row in overall if row['method'] == NAMES[method] and row['step'] == 150000)
208
- relative.append(dict(method=NAMES[method], image_psnr_delta=after['image_psnr'] - before['image_psnr'],
209
- depth_error_reduction_percent=100 * (before['depth_l1_m'] - after['depth_l1_m']) / abs(before['depth_l1_m']),
210
- lpips_reduction_percent=100 * (before['lpips'] - after['lpips']) / abs(before['lpips'])))
211
- report.extend([table(relative, ['method', 'image_psnr_delta', 'depth_error_reduction_percent', 'lpips_reduction_percent']),
212
- '上表 PSNR 差值单位为 dB,不将 dB 做百分比解释;误差降低百分比为 '
213
- '(100k误差−150k误差)/|100k误差|×100,负值表示误差增大。',
214
- '## 4. 分 views 总体结果'])
215
- for views in (3, 5, 10):
216
- report.append(f'### {views} views:每模型每 checkpoint 为 9 场景均值')
217
- report.extend(metric_tables(averages(records, views=views), ['method', 'step', 'count']))
218
- report.append('## 5. 分场景完整结果与全部样本')
219
- for scene in scenes:
220
- selected = [row for row in records if row['scene'] == scene]
221
- selected.sort(key=lambda row: (row['views'], METHODS.index(row['method_id']), row['step']))
222
- protocol = selected[0]['protocol']
223
- report.extend([f'<a id="scene-{scene.lower()}"></a>', f'### 场景:{scene}',
224
- f'测试帧数:{len(canonical[scene])};配置数:9;checkpoint 评测数:{len(selected)};'
225
- f'逐帧评测记录数:{sum(len(row["samples"]) for row in selected)}。',
226
- f'固定直方图峰值:{text(protocol["histogram_peak"])} counts;'
227
- f'固定图像尺度 D:{text(protocol["display_scale"])} counts;'
228
- f'协议:`{protocol["protocol"]}` / `{protocol["image_metric_definition"]["protocol"]}`。',
229
- '#### 模型均值(该场景 3/5/10 views 等权)'])
230
- scene_means = averages(selected)
231
- report.extend(metric_tables(scene_means, ['method', 'step', 'count']))
232
- latest_scene = [row for row in scene_means if row['step'] == 150000]
233
- image_best = max(latest_scene, key=lambda row: row['image_psnr'])
234
- depth_best = min(latest_scene, key=lambda row: row['depth_l1_m'])
235
- report.append(f'该场景 150k 的模型均值:Image PSNR 最优为 {image_best["method"]} '
236
- f'({text(image_best["image_psnr"])} dB),Depth L1 最优为 {depth_best["method"]}'
237
- f'({text(depth_best["depth_l1_m"])} m)。这是结果描述,不用于选择或替换 checkpoint。')
238
- report.append('#### 全部配置的聚合指标(18 行,无筛选)')
239
- report.extend(metric_tables(selected, ['method', 'views', 'step', 'recovered']))
240
- report.append('#### 原始划分的全部训练样本文件名')
241
- train_rows = []
242
- for views, directory in [(3, 'three_views'), (5, 'five_views'), (10, 'ten_views')]:
243
- path = ROOT / 'experiments/data' / scene / directory / 'transforms_train.json'
244
- frames = json.loads(path.read_text())['frames']
245
- if len(frames) != views:
246
- raise ValueError(f'Unexpected train split length: {path}')
247
- train_rows.extend(dict(views=views, index=index, frame=frame['file_path']) for index, frame in enumerate(frames))
248
- report.append(table(train_rows, ['views', 'index', 'frame']))
249
- report.append('源划分缓存:`experiments/data/' + scene + '/{three_views,five_views,ten_views}/transforms_train.json`。'
250
- '帧名仅换为 NPZ 缓存扩展名;训练集合间存在的重叠不作去重。')
251
- report.append('#### 全部正式测试样本:逐模型 × views × checkpoint')
252
- for row in selected:
253
- report.extend([f'##### {row["method"]} · {row["views"]} views · {row["step"]} 步',
254
- f'配置 ID:`{row["job"]["id"]}`;恢复标记:{row["recovered"]}。\n\n'
255
- f'原始逐帧结果:`{row["source"]}/metrics_per_view.json`。\n\n'
256
- f'原始聚合/协议:同目录 `metrics_aggregate.json`、`evaluation_protocol.json`。',
257
- table(row['samples'], ['view', 'frame', 'valid_pixels'] + PRIMARY),
258
- table(row['samples'], ['view', 'prediction_scale', 'prediction_gamma'] + AUXILIARY)])
259
- report.append('## 6. 恢复、归档及结果解释边界')
260
- recovered = [row for row in records if row['recovered'] != '—' and not row['job'].get('retrained_from_scratch')]
261
- adjusted = [row for row in records if row['recovered'] != '—']
262
- report.extend([table(adjusted, ['scene', 'method', 'views', 'step', 'recovered']),
263
- '- TransientNeRF material_building / 10 views:修复 GradScaler 使用错误,从有效 100k 模型和优化器等状态恢复;'
264
- '旧 Adam moments 按原梯度缩放单位转换。有效 100k 结果保留。\n'
265
- '- TransientAngelo physics_building3 / 5、10 views:原 150k 参数 NaN、占用网格为空,导致全零预测。'
266
- '从有效 100k 完整训练状态恢复,仅辐射 MLP 启用同参数布局的 FP32 运算;其他训练参数及评分口径不变。\n'
267
- '- TransientAngelo physics_building3 / 3 views:从头独立重训,关闭 AMP,并启用 FP32 辐射 MLP。'
268
- '原 seed、划分、学习率、batch、loss 和 150k 计划不变;新 100k/150k 均纳入本报告。\n'
269
- '- 上述恢复均重新设置 seed=42;原 checkpoint 未保存完整随机生成器状态,因��不是原始轨迹的逐位重放。\n'
270
- '- 本报告主表只使用正式目录中的当前有效结果。归档失败/全零输出不能被当作额外模型、额外 seed 或额外独立样本。\n'
271
- '- physics_building3 仍可能存在较大深度/计数域误差;修复数值崩溃不等同于证明所有重建质量问题已解决。'
272
- '显示域图像指标良好也不保证直方图或深度指标良好。\n'
273
- '- 本实验采用当前仓库模板适配九场景的配置及统一评测,不宣称逐场景精确复现论文原始设置。'])
274
- difficult = next(row for row in records if row['method_id'] == 'transientangelo'
275
- and row['scene'] == 'physics_building3' and row['views'] == 3 and row['step'] == 100000)
276
- report.append('更新后,TransientAngelo physics_building3 / 3 views / 100k 的 Image PSNR 为 '
277
- f'{text(difficult["image_psnr"])} dB,Depth L1 为 {text(difficult["depth_l1_m"])} m;'
278
- '旧近黑版本不再混入本次均值,但原始结果与旧版报告仍保留。'
279
- '新 100k 的 test 0/1 仍过亮,Transient PSNR 分别约 -5.39/-1.21 dB;'
280
- '重训 150k 的五项主要指标均不如重训 100k。没有删除这些低分样本,也没有据测试分数更换步数。'
281
- '重训结果与对比详见 `experiments/run_20261025/retrain_ta_physics3_3views_20261101/RESULTS.md`。')
282
- for row in recovered:
283
- report.append(f'- `{row["job"]["id"]}` 的恢复说明:`experiments/run_20261025/{row["job"]["id"]}/RECOVERY.md`。')
284
- report.append('### 已归档的两组 TA 无效 150k 与当前恢复结果(仅用于问题追踪,不参与主表均值)')
285
- archive_comparison = []
286
- for row in recovered:
287
- if row['method_id'] != 'transientangelo':
288
- continue
289
- archive = Path(row['job']['recovery_history'][-1]['archived_output'])
290
- old = json.loads((archive / 'test_150000/unified_metrics/metrics_aggregate.json').read_text())
291
- archive_comparison.extend([dict(method=row['method'], views=row['views'], version='归档无效全零输出', **old),
292
- dict(method=row['method'], views=row['views'], version='当前恢复结果', **{key: row[key] for key in METRICS})])
293
- report.append(f'归档:`{archive.relative_to(ROOT)}`。')
294
- report.extend(metric_tables(archive_comparison, ['method', 'views', 'version']))
295
- report.extend(['## 7. 复核与文件来源',
296
- f'- 正式聚合结果:{len(records)} 组;每组全部 {len(METRICS)} 个指标。\n'
297
- f'- 正式逐测试帧记录:{sample_count} 条,每条均展示完整 13 项指标及全部 5 个样本元信息字段。\n'
298
- '- 已核对:每组完整标记、预期帧数、唯一帧序号、协议帧顺序、跨模型/配置的同场景帧名与有效像素数一致。\n'
299
- '- 已核对:逐帧与聚合指标均为有限数;每个聚合指标与逐帧算术平均相符。\n'
300
- '- 数据来源仅为当前本地正式实验结果、原始划分缓存和已有恢复记录,未引用外部论文数值。\n'
301
- '- 本报告由 `experiments/write_full_report.py` 生成;重生成命令:'
302
- '`experiments/.venv/bin/python experiments/write_full_report.py`。'])
303
- OUTPUT.write_text('\n\n'.join(report) + '\n')
304
- print(f'Report: {OUTPUT}')
305
- print(f'Scenes: {len(scenes)}; evaluations: {len(records)}; test sample rows: {sample_count}; metrics: {len(METRICS)}')
306
- print(f'Bytes: {OUTPUT.stat().st_size}')
307
-
308
-
309
- if __name__ == '__main__':
310
- main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
codes/reconstruction/experiments/write_test_samples.py DELETED
@@ -1,106 +0,0 @@
1
- import csv
2
- from datetime import datetime
3
- from zoneinfo import ZoneInfo
4
-
5
- from write_100k_report import METRICS
6
- from write_english_reports import CELLS, DEFINITIONS
7
- from write_full_report import METHODS, RUN, load_reporting_state, load_results, text
8
-
9
-
10
- OUTPUT = RUN / 'TEST_SAMPLES_100K_EN.md'
11
- CSV_OUTPUT = RUN / 'test_samples_100k.csv'
12
- HEADERS = ['Test index', 'Original test frame', 'Method', 'Image PSNR (dB) ↑',
13
- 'Transient PSNR (dB) ↑', 'SSIM ↑', 'LPIPS ↓', 'Depth L1 (m) ↓']
14
- CSV_COLUMNS = ['scene', 'training_views', 'step', 'test_index', 'frame', 'method',
15
- 'method_id', 'job_id', 'valid_pixels', *METRICS, 'retrained_from_scratch',
16
- 'recovery_or_retraining', 'source_json']
17
-
18
-
19
- def main():
20
- records, canonical = load_results(load_reporting_state(), steps=(100000,))
21
- scenes = sorted(canonical)
22
- sample_count = sum(len(record['samples']) for record in records)
23
- generated = datetime.now(ZoneInfo('America/New_York')).isoformat(timespec='seconds')
24
- report = ['# SP-TransientBench: Every Test Sample at 100k',
25
- f'Generated: {generated} (America/New_York).',
26
- '## Scope',
27
- f'- All {sample_count} test-sample records from {len(records)} evaluations: '
28
- f'{len(scenes)} scenes × {len(METHODS)} methods × 3/5/10 training views, '
29
- 'at the 100,000-step checkpoint only.',
30
- '- Every row is one test frame evaluated by one method for one training '
31
- 'view count, not a scene mean. Test indices are zero-based and '
32
- 'scene-local; original filenames are retained.',
33
- '- No test frames are filtered, subsampled, or deduplicated across '
34
- 'methods or training view counts. Low-scoring frames remain included.',
35
- '- Markdown uses 12 significant digits; the companion CSV retains '
36
- 'the original numeric values and adds scene, training-view count, '
37
- 'step, valid-pixel count, retraining status, and the source JSON path.',
38
- f'Companion CSV: `{CSV_OUTPUT.name}`.',
39
- '## Metric Definitions',
40
- *[f'- **{HEADERS[index + 3]}** (`{key}`): {DEFINITIONS[key]}'
41
- for index, key in enumerate(METRICS)],
42
- 'These are the existing official evaluation metrics; their masks, '
43
- 'training-derived fixed scales, and display transforms are unchanged. '
44
- 'Detailed protocol: `FULL_RESULTS_ALL_SCENES_EN.md`.',
45
- '## Result Sources',
46
- 'The TransientAngelo / physics_building3 / 3-view 100k results use '
47
- 'the corresponding checkpoint from the independent FP32 retraining '
48
- 'on 2026-11-01. Sources for the other 80 configurations are unchanged. '
49
- 'Old and new runs are not counted as additional samples, and '
50
- 'checkpoints are not selected by test scores. The new source is '
51
- '`experiments/run_20261025/transientangelo__physics_building3__3views/`. '
52
- 'Original raw results are retained under '
53
- '`experiments/run_20261025/archive_before_ta3_merge_20261103/`.',
54
- 'For the retrained TransientAngelo / physics_building3 / 3-view '
55
- '100k checkpoint, test frames 0/1 remain overbright. Both frames '
56
- 'are included below, including their negative Transient PSNR values.',
57
- '## Navigation',
58
- ' · '.join(f'[{views} training views](#views-{views})' for views in (3, 5, 10))]
59
- csv_rows = []
60
- for views in (3, 5, 10):
61
- report.extend([f'<a id="views-{views}"></a>', f'## {views} Training Views · 100k',
62
- ' · '.join(f'[{scene}](#views-{views}-{scene.lower()})' for scene in scenes)])
63
- for scene in scenes:
64
- selected = [next(record for record in records if record['views'] == views
65
- and record['scene'] == scene and record['method_id'] == method)
66
- for method in METHODS]
67
- report.extend([f'<a id="views-{views}-{scene.lower()}"></a>',
68
- f'### {scene} · {views} Training Views · 100k',
69
- f'{len(canonical[scene])} test frames × {len(METHODS)} methods '
70
- f'= {len(canonical[scene]) * len(METHODS)} rows.'])
71
- table_rows = ['| ' + ' | '.join(HEADERS) + ' |',
72
- '| ' + ' | '.join('---' for header in HEADERS) + ' |']
73
- for test_index in range(len(canonical[scene])):
74
- for record in selected:
75
- sample = record['samples'][test_index]
76
- values = [sample['view'], sample['frame'], record['method'],
77
- *[sample[key] for key in METRICS]]
78
- table_rows.append('| ' + ' | '.join(text(value) for value in values) + ' |')
79
- csv_rows.append(dict(
80
- scene=scene, training_views=views, step=record['step'],
81
- test_index=sample['view'], frame=sample['frame'],
82
- method=record['method'], method_id=record['method_id'],
83
- job_id=record['job']['id'], valid_pixels=sample['valid_pixels'],
84
- **{key: sample[key] for key in METRICS},
85
- retrained_from_scratch=bool(record['job'].get('retrained_from_scratch')),
86
- recovery_or_retraining=CELLS.get(record['recovered'], record['recovered']),
87
- source_json=f'{record["source"]}/metrics_per_view.json'))
88
- report.append('\n'.join(table_rows))
89
- report.append('Sources:')
90
- report.extend(f'- {record["method"]}: '
91
- f'`{record["source"]}/metrics_per_view.json`.' for record in selected)
92
- report.extend(['## Regeneration',
93
- '`experiments/.venv/bin/python experiments/write_test_samples.py`'])
94
- OUTPUT.write_text('\n\n'.join(report) + '\n')
95
- with CSV_OUTPUT.open('w', newline='') as output:
96
- writer = csv.DictWriter(output, fieldnames=CSV_COLUMNS)
97
- writer.writeheader()
98
- writer.writerows(csv_rows)
99
- print(f'English sample report: {OUTPUT}')
100
- print(f'CSV: {CSV_OUTPUT}')
101
- print(f'Evaluations: {len(records)}; sample rows: {len(csv_rows)}; '
102
- f'metric cells: {len(csv_rows) * len(METRICS)}')
103
-
104
-
105
- if __name__ == '__main__':
106
- main()