Upload 3 files
Browse files- .gitattributes +2 -0
- convert_dump.py +78 -0
- snapshot_bw.dump +3 -0
- snapshot_fw.dump +3 -0
.gitattributes
CHANGED
|
@@ -53,3 +53,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 53 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 54 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 55 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 53 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 54 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 55 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
| 56 |
+
snapshot_bw.dump filter=lfs diff=lfs merge=lfs -text
|
| 57 |
+
snapshot_fw.dump filter=lfs diff=lfs merge=lfs -text
|
convert_dump.py
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import io
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
|
| 4 |
+
import torch
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
def save_tensor(tensor, name):
|
| 8 |
+
f = io.BytesIO()
|
| 9 |
+
torch.save(tensor, f, _use_new_zipfile_serialization=True)
|
| 10 |
+
with open(name, "wb") as out_f:
|
| 11 |
+
out_f.write(f.getbuffer())
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
def process_forward_dump(dump_path: Path, output_path: Path):
|
| 15 |
+
output_path.mkdir(exist_ok=True, parents=True)
|
| 16 |
+
data = torch.load(dump_path)
|
| 17 |
+
arg_names = [
|
| 18 |
+
"bg",
|
| 19 |
+
"means3D",
|
| 20 |
+
"colors_precomp",
|
| 21 |
+
"opacities",
|
| 22 |
+
"scales",
|
| 23 |
+
"rotations",
|
| 24 |
+
"scale_modifier",
|
| 25 |
+
"cov3Ds_precomp",
|
| 26 |
+
"viewmatrix",
|
| 27 |
+
"projmatrix",
|
| 28 |
+
"tanfovx",
|
| 29 |
+
"tanfovy",
|
| 30 |
+
"image_height",
|
| 31 |
+
"image_width",
|
| 32 |
+
"sh",
|
| 33 |
+
"sh_degree",
|
| 34 |
+
"campos",
|
| 35 |
+
"prefiltered",
|
| 36 |
+
"debug",
|
| 37 |
+
]
|
| 38 |
+
for tensor, name in zip(data, arg_names):
|
| 39 |
+
save_tensor(tensor, str(output_path / name) + ".pt")
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
def process_backward_dump(dump_path: Path, output_path: Path):
|
| 43 |
+
output_path.mkdir(exist_ok=True, parents=True)
|
| 44 |
+
data = torch.load(dump_path)
|
| 45 |
+
arg_names = [
|
| 46 |
+
"bg",
|
| 47 |
+
"means3D",
|
| 48 |
+
"radii",
|
| 49 |
+
"colors_precomp",
|
| 50 |
+
"scales",
|
| 51 |
+
"rotations",
|
| 52 |
+
"scale_modifier",
|
| 53 |
+
"cov3Ds_precomp",
|
| 54 |
+
"viewmatrix",
|
| 55 |
+
"projmatrix",
|
| 56 |
+
"tanfovx",
|
| 57 |
+
"tanfovy",
|
| 58 |
+
"grad_out_color",
|
| 59 |
+
"grad_depth",
|
| 60 |
+
"grad_out_alpha",
|
| 61 |
+
"sh",
|
| 62 |
+
"sh_degree",
|
| 63 |
+
"campos",
|
| 64 |
+
"geomBuffer",
|
| 65 |
+
"num_rendered",
|
| 66 |
+
"binningBuffer",
|
| 67 |
+
"imgBuffer",
|
| 68 |
+
"alpha",
|
| 69 |
+
"debug"
|
| 70 |
+
]
|
| 71 |
+
for tensor, name in zip(data, arg_names):
|
| 72 |
+
save_tensor(tensor, str(output_path / name) + ".pt")
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
if __name__ == '__main__':
|
| 76 |
+
global_path = Path("/home/vy/projects/gaussian-rasterizer/test_data")
|
| 77 |
+
process_forward_dump(global_path / "snapshot_fw.dump", global_path / "forward_tensors")
|
| 78 |
+
process_backward_dump(global_path / "snapshot_bw.dump", global_path / "backward_tensors")
|
snapshot_bw.dump
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a4681eb658702be08927df591f6e9e27f27acbfd4af3cf7c59218920a0147b56
|
| 3 |
+
size 159351736
|
snapshot_fw.dump
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:18b4b8e9d3faed04a69f74588fd48a3d6af8a9726c25076eb3d720297605ab30
|
| 3 |
+
size 33215025
|