reduced-3dgs 1.10.3__cp310-cp310-win_amd64.whl → 1.10.4__cp310-cp310-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of reduced-3dgs might be problematic. Click here for more details.

@@ -262,36 +262,46 @@ class VectorQuantizer(AbstractQuantizer):
262
262
 
263
263
  PlyData([el, *cb]).write(ply_path)
264
264
 
265
- def load_quantized(self, model: GaussianModel, ply_path: str) -> GaussianModel:
266
- plydata = PlyData.read(ply_path)
267
-
265
+ def parse_ids(self, plydata: PlyData, max_sh_degree: int, device: torch.device) -> Dict[str, torch.Tensor]:
268
266
  ids_dict = {}
269
267
  elements = plydata['vertex']
270
- kwargs = dict(dtype=torch.long, device=model._xyz.device)
268
+ kwargs = dict(dtype=torch.long, device=device)
271
269
  ids_dict["rotation_re"] = torch.tensor(elements["rot_re"].copy(), **kwargs)
272
270
  ids_dict["rotation_im"] = torch.tensor(elements["rot_im"].copy(), **kwargs)
273
271
  ids_dict["opacity"] = torch.tensor(elements["opacity"].copy(), **kwargs)
274
272
  ids_dict["scaling"] = torch.tensor(elements["scale"].copy(), **kwargs)
275
273
  ids_dict["features_dc"] = torch.tensor(elements["f_dc"].copy(), **kwargs).unsqueeze(-1)
276
- for sh_degree in range(model.max_sh_degree):
274
+ for sh_degree in range(max_sh_degree):
277
275
  ids_dict[f'features_rest_{sh_degree}'] = torch.tensor(np.stack([elements[f'f_rest_{sh_degree}_{ch}'] for ch in range(3)], axis=1), **kwargs)
276
+ return ids_dict
278
277
 
278
+ def parse_codebook(self, plydata: PlyData, max_sh_degree: int, device: torch.device) -> Dict[str, torch.Tensor]:
279
279
  codebook_dict = {}
280
- kwargs = dict(dtype=torch.float32, device=model._xyz.device)
280
+ kwargs = dict(dtype=torch.float32, device=device)
281
281
  codebook_dict["rotation_re"] = torch.tensor(plydata["codebook_rot_re"]["rot_re"], **kwargs).unsqueeze(-1)
282
282
  codebook_dict["rotation_im"] = torch.tensor(np.stack([plydata["codebook_rot_im"][f'rot_im_{ch}'] for ch in range(3)], axis=1), **kwargs)
283
283
  codebook_dict["opacity"] = torch.tensor(plydata["codebook_opacity"]["opacity"], **kwargs).unsqueeze(-1)
284
284
  codebook_dict["scaling"] = torch.tensor(np.stack([plydata["codebook_scaling"][f'scaling_{ch}'] for ch in range(3)], axis=1), **kwargs)
285
285
  codebook_dict["features_dc"] = torch.tensor(np.stack([plydata["codebook_f_dc"][f'f_dc_{ch}'] for ch in range(3)], axis=1), **kwargs)
286
- for sh_degree in range(model.max_sh_degree):
286
+ for sh_degree in range(max_sh_degree):
287
287
  n_channels = (sh_degree + 2) ** 2 - (sh_degree + 1) ** 2
288
288
  codebook_dict[f'features_rest_{sh_degree}'] = torch.tensor(np.stack([plydata[f"codebook_f_rest_{sh_degree}"][f'f_rest_{sh_degree}_{ch}'] for ch in range(n_channels)], axis=1), **kwargs)
289
+ return codebook_dict
289
290
 
290
- self._codebook_dict = codebook_dict
291
-
291
+ def parse_xyz(self, plydata: PlyData, device: torch.device) -> torch.Tensor:
292
+ elements = plydata['vertex']
293
+ kwargs = dict(dtype=torch.float32, device=device)
292
294
  xyz = torch.stack([
293
295
  torch.tensor(elements["x"].copy(), **kwargs),
294
296
  torch.tensor(elements["y"].copy(), **kwargs),
295
297
  torch.tensor(elements["z"].copy(), **kwargs),
296
298
  ], dim=1)
299
+ return xyz
300
+
301
+ def load_quantized(self, model: GaussianModel, ply_path: str) -> GaussianModel:
302
+ plydata = PlyData.read(ply_path)
303
+ ids_dict = self.parse_ids(plydata, model.max_sh_degree, model._xyz.device)
304
+ codebook_dict = self.parse_codebook(plydata, model.max_sh_degree, model._xyz.device)
305
+ xyz = self.parse_xyz(plydata, model._xyz.device)
306
+ self._codebook_dict = codebook_dict
297
307
  return self.dequantize(model, ids_dict, codebook_dict, xyz=xyz, replace=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: reduced_3dgs
3
- Version: 1.10.3
3
+ Version: 1.10.4
4
4
  Summary: Refactored code for the paper "Reducing the Memory Footprint of 3D Gaussian Splatting"
5
5
  Home-page: https://github.com/yindaheng98/reduced-3dgs
6
6
  Author: yindaheng98
@@ -3,12 +3,12 @@ reduced_3dgs/combinations.py,sha256=k4ErxpAscCqJMtVXZ29KGQjw2VoZMV0W3V4u3nj0e-Y,
3
3
  reduced_3dgs/prepare.py,sha256=MFUUckRHKfgcva4ZOBxfPFyE95N-OlCQLplpmEPuzOk,4440
4
4
  reduced_3dgs/quantize.py,sha256=BVqBb2tQgiP3hap5-OByD8VELtJJGfEeFzaVFyzCJZU,2572
5
5
  reduced_3dgs/train.py,sha256=yRQPQv-hTOBQN-tqGHYs2aIZ0AbWq158CXpthYN2cfw,5666
6
- reduced_3dgs/diff_gaussian_rasterization/_C.cp310-win_amd64.pyd,sha256=17gLI7OU-vnvt6QUC-6yZGbvSX8MPk6jeUyIg096pkg,1618432
6
+ reduced_3dgs/diff_gaussian_rasterization/_C.cp310-win_amd64.pyd,sha256=LHHSwD5jDEkO_0PH91Xzbsykr72WQQ7Wq_q3dvQ7Fss,1618432
7
7
  reduced_3dgs/diff_gaussian_rasterization/__init__.py,sha256=oV6JjTc-50MscX4XHeIWSgLr3l8Y25knBIs-0gRbJr4,7932
8
8
  reduced_3dgs/importance/__init__.py,sha256=neJsbY5cLikEGBQGdR4MjwCQ5VWVikT1357DwL0EtWU,289
9
9
  reduced_3dgs/importance/combinations.py,sha256=eAdykeTdvRGCHxskjILQnZVaqQVvwC-0wMxdgYMeeDs,2922
10
10
  reduced_3dgs/importance/trainer.py,sha256=Sj4ORvoYtFT7z3hifzFZDfhFyqumHraXyk3vMVtk0AU,12661
11
- reduced_3dgs/importance/diff_gaussian_rasterization/_C.cp310-win_amd64.pyd,sha256=VKBmq1HG8Veim6qUIWQqyvxBPwRNYyVgG3m7tUl0uKg,1308160
11
+ reduced_3dgs/importance/diff_gaussian_rasterization/_C.cp310-win_amd64.pyd,sha256=FJlv_ytBpqI0i2lXSc2iWPPMM0lC8j8HLfsP_pTPQOU,1308160
12
12
  reduced_3dgs/importance/diff_gaussian_rasterization/__init__.py,sha256=Tix8auyXBb_QFQtXrV3sLE9kdnl5zgHH0BbqcFzDp84,12850
13
13
  reduced_3dgs/pruning/__init__.py,sha256=E_YxJ9cDV_B6EJbYUBEcuRYMIht_C72rI1VJUXFCLpM,201
14
14
  reduced_3dgs/pruning/combinations.py,sha256=QhXt2C7pTXhwzp9hPL9dVdiQzz0cUQpm5qljqytPEsM,2345
@@ -16,14 +16,14 @@ reduced_3dgs/pruning/trainer.py,sha256=JJml-uYfDfUpbsjRNZbIvnUYYslVgFXkhejbkYSo0
16
16
  reduced_3dgs/quantization/__init__.py,sha256=1z1xMn3yj9u7cR9JizGrI3WSyIES_Tqq6oDquvglSeo,225
17
17
  reduced_3dgs/quantization/abc.py,sha256=rsi8HFRwQCltWTYiJ3BpygtQDT7hK6J01jKMOboOY8w,1910
18
18
  reduced_3dgs/quantization/exclude_zeros.py,sha256=fKSgjHous4OpdI6mQi9z23if9jnbB79w2jChpxkCJWw,2381
19
- reduced_3dgs/quantization/quantizer.py,sha256=HZFuYs1Uxq3aXzn9Ow1LSDxF4myh_vfgvovVDJoc2BM,17001
19
+ reduced_3dgs/quantization/quantizer.py,sha256=lsaJ4yjxquC9XCDZPTGIKe8EgHAEwmVw9rt73oezjmc,17686
20
20
  reduced_3dgs/quantization/wrapper.py,sha256=cyXqfJgo9b3fS7DYXxOk5LmQudvrEhweOebFsjRnXiQ,2549
21
21
  reduced_3dgs/shculling/__init__.py,sha256=nP2BejDCUdCmJNRbg0hfhHREO6jyZXwIcRiw6ttVgqo,149
22
22
  reduced_3dgs/shculling/gaussian_model.py,sha256=f8QWaL09vaV9Tcf6Dngjg_Fmk1wTQPAjWhuhI_N02Y8,2877
23
23
  reduced_3dgs/shculling/trainer.py,sha256=9hwR77djhZpyf-URhwKHjnLbe0ZAOS-DIw58RzkcHXQ,6369
24
- reduced_3dgs/simple_knn/_C.cp310-win_amd64.pyd,sha256=1Tk0j6Lj9aHEb2aGD-I93BcqvjVWvvZXZJF-EVPY-Q0,1255424
25
- reduced_3dgs-1.10.3.dist-info/licenses/LICENSE.md,sha256=LQ4_LAqlncGkg_mQy5ykMAFtQDSPB0eKmIEtBut0yjw,4916
26
- reduced_3dgs-1.10.3.dist-info/METADATA,sha256=DGxZflgGcJRjRyeqz0CTkgSUeJpGGAgKDkOJ0mG5Dk4,13015
27
- reduced_3dgs-1.10.3.dist-info/WHEEL,sha256=KUuBC6lxAbHCKilKua8R9W_TM71_-9Sg5uEP3uDWcoU,101
28
- reduced_3dgs-1.10.3.dist-info/top_level.txt,sha256=PpU5aT3-baSCdqCtTaZknoB32H93UeKCkYDkRCCZMEI,13
29
- reduced_3dgs-1.10.3.dist-info/RECORD,,
24
+ reduced_3dgs/simple_knn/_C.cp310-win_amd64.pyd,sha256=cknfimJJGEUL7vCBdTYuTNhHZdhGTeKJr8KVQJdRD0M,1255424
25
+ reduced_3dgs-1.10.4.dist-info/licenses/LICENSE.md,sha256=LQ4_LAqlncGkg_mQy5ykMAFtQDSPB0eKmIEtBut0yjw,4916
26
+ reduced_3dgs-1.10.4.dist-info/METADATA,sha256=TfBJNYmRSs23HhMOj15mrTFzryN015ZgGTeqUMKza7w,13015
27
+ reduced_3dgs-1.10.4.dist-info/WHEEL,sha256=KUuBC6lxAbHCKilKua8R9W_TM71_-9Sg5uEP3uDWcoU,101
28
+ reduced_3dgs-1.10.4.dist-info/top_level.txt,sha256=PpU5aT3-baSCdqCtTaZknoB32H93UeKCkYDkRCCZMEI,13
29
+ reduced_3dgs-1.10.4.dist-info/RECORD,,