reduced-3dgs 1.10.2__cp311-cp311-win_amd64.whl → 1.10.3__cp311-cp311-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.

@@ -206,8 +206,7 @@ class VectorQuantizer(AbstractQuantizer):
206
206
  ids_dict = self.find_nearest_cluster_id(model, self._codebook_dict)
207
207
  return ids_dict, codebook_dict
208
208
 
209
- def save_quantized(self, model: GaussianModel, ply_path: str):
210
- ids_dict, codebook_dict = self.quantize(model, update_codebook=False)
209
+ def ply_dtype(self, max_sh_degree: int):
211
210
  dtype_full = [
212
211
  ('x', 'f4'), ('y', 'f4'), ('z', 'f4'),
213
212
  ('nx', 'f4'), ('ny', 'f4'), ('nz', 'f4'),
@@ -217,13 +216,16 @@ class VectorQuantizer(AbstractQuantizer):
217
216
  ('scale', self.force_code_dtype or compute_uint_dtype(self.num_clusters_scaling)),
218
217
  ('f_dc', self.force_code_dtype or compute_uint_dtype(self.num_clusters_features_dc)),
219
218
  ]
220
- for sh_degree in range(model.max_sh_degree):
219
+ for sh_degree in range(max_sh_degree):
221
220
  force_code_dtype = self.force_code_dtype or compute_uint_dtype(self.num_clusters_features_rest[sh_degree])
222
221
  dtype_full.extend([
223
222
  (f'f_rest_{sh_degree}_0', force_code_dtype),
224
223
  (f'f_rest_{sh_degree}_1', force_code_dtype),
225
224
  (f'f_rest_{sh_degree}_2', force_code_dtype),
226
225
  ])
226
+ return dtype_full
227
+
228
+ def ply_data(self, model: GaussianModel, ids_dict: Dict[str, torch.Tensor]):
227
229
  data_full = [
228
230
  *np.array_split(model._xyz.detach().cpu().numpy(), 3, axis=1),
229
231
  *np.array_split(torch.zeros_like(model._xyz).detach().cpu().numpy(), 3, axis=1),
@@ -236,6 +238,12 @@ class VectorQuantizer(AbstractQuantizer):
236
238
  for sh_degree in range(model.max_sh_degree):
237
239
  features_rest = ids_dict[f'features_rest_{sh_degree}'].cpu().numpy()
238
240
  data_full.extend(np.array_split(features_rest, 3, axis=1))
241
+ return data_full
242
+
243
+ def save_quantized(self, model: GaussianModel, ply_path: str):
244
+ ids_dict, codebook_dict = self.quantize(model, update_codebook=False)
245
+ dtype_full = self.ply_dtype(model.max_sh_degree)
246
+ data_full = self.ply_data(model, ids_dict)
239
247
 
240
248
  elements = np.rec.fromarrays([data.squeeze(-1) for data in data_full], dtype=dtype_full)
241
249
  el = PlyElement.describe(elements, 'vertex')
reduced_3dgs/quantize.py CHANGED
@@ -13,6 +13,7 @@ def copy_not_exists(source, destination):
13
13
 
14
14
 
15
15
  def quantize(source, destination, iteration, sh_degree, device, **kwargs):
16
+ os.makedirs(destination, exist_ok=True)
16
17
  copy_not_exists(os.path.join(source, "cfg_args"), os.path.join(destination, "cfg_args"))
17
18
  copy_not_exists(os.path.join(source, "cameras.json"), os.path.join(destination, "cameras.json"))
18
19
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: reduced_3dgs
3
- Version: 1.10.2
3
+ Version: 1.10.3
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
@@ -1,14 +1,14 @@
1
1
  reduced_3dgs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  reduced_3dgs/combinations.py,sha256=k4ErxpAscCqJMtVXZ29KGQjw2VoZMV0W3V4u3nj0e-Y,9401
3
3
  reduced_3dgs/prepare.py,sha256=MFUUckRHKfgcva4ZOBxfPFyE95N-OlCQLplpmEPuzOk,4440
4
- reduced_3dgs/quantize.py,sha256=Y44qHyFdOIqke7NoeqXmyKloS43j-al74ZiNsuZZHbM,2527
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.cp311-win_amd64.pyd,sha256=KOkmyzU2nmWLI0_ItQ8T2KWEHYTCReinaEObKKW_ZrI,1632256
6
+ reduced_3dgs/diff_gaussian_rasterization/_C.cp311-win_amd64.pyd,sha256=KHsGqF7DgOT56GTN7F7YOOKufInFDVWFIFsAZqfx4iQ,1632256
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.cp311-win_amd64.pyd,sha256=Q57dw0lD8Y7rQamkbnDWIxjGVmJ50X6i9l1kv6ow928,1315840
11
+ reduced_3dgs/importance/diff_gaussian_rasterization/_C.cp311-win_amd64.pyd,sha256=K6yiXiUH3lSmChRc2HmBC-oPITgoWznnbT0oZ5J80Vw,1315840
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=VL96ZTY7G8jUt-fLBJ3gw1MQV46NkHOBJyfUPsmDQxE,16712
19
+ reduced_3dgs/quantization/quantizer.py,sha256=HZFuYs1Uxq3aXzn9Ow1LSDxF4myh_vfgvovVDJoc2BM,17001
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.cp311-win_amd64.pyd,sha256=goRrAjghw7crBObLb6cuMONH3--q9uZjBoj3gRTQkeY,1263616
25
- reduced_3dgs-1.10.2.dist-info/licenses/LICENSE.md,sha256=LQ4_LAqlncGkg_mQy5ykMAFtQDSPB0eKmIEtBut0yjw,4916
26
- reduced_3dgs-1.10.2.dist-info/METADATA,sha256=5YuWENChjx4yhAaCJ5pokMNsyE0c_o2vIcgiE0SBXuY,13015
27
- reduced_3dgs-1.10.2.dist-info/WHEEL,sha256=JLOMsP7F5qtkAkINx5UnzbFguf8CqZeraV8o04b0I8I,101
28
- reduced_3dgs-1.10.2.dist-info/top_level.txt,sha256=PpU5aT3-baSCdqCtTaZknoB32H93UeKCkYDkRCCZMEI,13
29
- reduced_3dgs-1.10.2.dist-info/RECORD,,
24
+ reduced_3dgs/simple_knn/_C.cp311-win_amd64.pyd,sha256=Av9a8Di3f2bHPPw4Dx3xI3Mj6aqor62zUCzzFlvn-8g,1263616
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=JLOMsP7F5qtkAkINx5UnzbFguf8CqZeraV8o04b0I8I,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,,