reduced-3dgs 1.8.19__cp311-cp311-win_amd64.whl → 1.9.0__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.

@@ -75,7 +75,7 @@ def count_render(self: GaussianModel, viewpoint_camera: Camera):
75
75
  }
76
76
 
77
77
 
78
- def prune_gaussians(model: GaussianModel, dataset: CameraDataset):
78
+ def prune_list(model: GaussianModel, dataset: CameraDataset):
79
79
  gaussian_count = torch.zeros(model.get_xyz.shape[0], device=model.get_xyz.device, dtype=torch.int)
80
80
  opacity_important_score = torch.zeros(model.get_xyz.shape[0], device=model.get_xyz.device, dtype=torch.float)
81
81
  T_alpha_important_score = torch.zeros(model.get_xyz.shape[0], device=model.get_xyz.device, dtype=torch.float)
@@ -84,7 +84,57 @@ def prune_gaussians(model: GaussianModel, dataset: CameraDataset):
84
84
  gaussian_count += out["gaussians_count"]
85
85
  opacity_important_score += out["opacity_important_score"]
86
86
  T_alpha_important_score += out["T_alpha_important_score"]
87
- return None
87
+ return gaussian_count, opacity_important_score, T_alpha_important_score
88
+
89
+
90
+ # return importance score with adaptive volume measure described in paper
91
+ def calculate_v_imp_score(gaussians: GaussianModel, imp_list, v_pow):
92
+ """
93
+ :param gaussians: A data structure containing Gaussian components with a get_scaling method.
94
+ :param imp_list: The importance scores for each Gaussian component.
95
+ :param v_pow: The power to which the volume ratios are raised.
96
+ :return: A list of adjusted values (v_list) used for pruning.
97
+ """
98
+ # Calculate the volume of each Gaussian component
99
+ volume = torch.prod(gaussians.get_scaling, dim=1)
100
+ # Determine the kth_percent_largest value
101
+ index = int(len(volume) * 0.9)
102
+ sorted_volume, _ = torch.sort(volume, descending=True)
103
+ kth_percent_largest = sorted_volume[index]
104
+ # Calculate v_list
105
+ v_list = torch.pow(volume / kth_percent_largest, v_pow)
106
+ v_list = v_list * imp_list
107
+ return v_list
108
+
109
+
110
+ def score2mask(percent, import_score: list, threshold=None):
111
+ sorted_tensor, _ = torch.sort(import_score, dim=0)
112
+ index_nth_percentile = int(percent * (sorted_tensor.shape[0] - 1))
113
+ value_nth_percentile = sorted_tensor[index_nth_percentile]
114
+ thr = min(threshold, value_nth_percentile) if threshold is not None else value_nth_percentile
115
+ prune_mask = (import_score <= thr)
116
+ return prune_mask
117
+
118
+
119
+ def prune_gaussians(gaussians: GaussianModel, dataset: CameraDataset, prune_type="important_score", prune_percent=0.1, prune_thr=None, v_pow=0.1):
120
+ gaussian_list, opacity_imp_list, T_alpha_imp_list = prune_list(gaussians, dataset)
121
+ match prune_type:
122
+ case "important_score":
123
+ mask = score2mask(prune_percent, opacity_imp_list, prune_thr)
124
+ case "v_important_score":
125
+ v_list = calculate_v_imp_score(gaussians, opacity_imp_list, v_pow)
126
+ mask = score2mask(prune_percent, v_list, prune_thr)
127
+ case "max_v_important_score":
128
+ v_list = opacity_imp_list * torch.max(gaussians.get_scaling, dim=1)[0]
129
+ mask = score2mask(prune_percent, v_list, prune_thr)
130
+ case "count":
131
+ mask = score2mask(prune_percent, gaussian_list, prune_thr)
132
+ case "T_alpha":
133
+ # new importance score defined by doji
134
+ mask = score2mask(prune_percent, T_alpha_imp_list, prune_thr)
135
+ case _:
136
+ raise Exception("Unsupportive prunning method")
137
+ return mask
88
138
 
89
139
 
90
140
  class ImportancePruner(DensifierWrapper):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: reduced_3dgs
3
- Version: 1.8.19
3
+ Version: 1.9.0
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
@@ -2,12 +2,12 @@ reduced_3dgs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  reduced_3dgs/combinations.py,sha256=FrZLxd3AZlHPSq_WJeEdGWH5zh40rAuV5txxr8HsSPY,7031
3
3
  reduced_3dgs/quantize.py,sha256=Y44qHyFdOIqke7NoeqXmyKloS43j-al74ZiNsuZZHbM,2527
4
4
  reduced_3dgs/train.py,sha256=jXHdXk05o_ebHjx_VBzcY6fRNn9EdKve6Tf5YC5an0o,9803
5
- reduced_3dgs/diff_gaussian_rasterization/_C.cp311-win_amd64.pyd,sha256=gmzHvGQ0dckkAtNQtEb47B8q0dqqDkVffANtRPUbU_0,1632256
5
+ reduced_3dgs/diff_gaussian_rasterization/_C.cp311-win_amd64.pyd,sha256=HEU-nPnNHqiNFZ86Lt27A_-MHwRh5zRSG43H38WSCeI,1632256
6
6
  reduced_3dgs/diff_gaussian_rasterization/__init__.py,sha256=oV6JjTc-50MscX4XHeIWSgLr3l8Y25knBIs-0gRbJr4,7932
7
7
  reduced_3dgs/importance/__init__.py,sha256=neJsbY5cLikEGBQGdR4MjwCQ5VWVikT1357DwL0EtWU,289
8
8
  reduced_3dgs/importance/combinations.py,sha256=Hxl0Syx2PD3l2bDzJ29_b2YdfC3etm3BH7gbteujGSU,1730
9
- reduced_3dgs/importance/trainer.py,sha256=AlkQR-dWD5A43ywLgdV2okSwB8Sg9b1u8Zi99u8Gd4A,5250
10
- reduced_3dgs/importance/diff_gaussian_rasterization/_C.cp311-win_amd64.pyd,sha256=ygopQDBcQr4DoGoA7nf6hr0GXXtTwUja2nDo0f00IDg,1316352
9
+ reduced_3dgs/importance/trainer.py,sha256=eYMmvVXFdNGEJ6vrOv8hglM0CGUyo0gTret4rsmIAE4,7717
10
+ reduced_3dgs/importance/diff_gaussian_rasterization/_C.cp311-win_amd64.pyd,sha256=f2XoUqAnEZgNL4IMqZaLkU41o-NLxOLBdBb-OT-Zlvw,1315840
11
11
  reduced_3dgs/importance/diff_gaussian_rasterization/__init__.py,sha256=Tix8auyXBb_QFQtXrV3sLE9kdnl5zgHH0BbqcFzDp84,12850
12
12
  reduced_3dgs/pruning/__init__.py,sha256=E_YxJ9cDV_B6EJbYUBEcuRYMIht_C72rI1VJUXFCLpM,201
13
13
  reduced_3dgs/pruning/combinations.py,sha256=UivTfbSMmaWYVi9E4OF-_AZA-WBWniMiX-wKUftezF8,2331
@@ -20,9 +20,9 @@ reduced_3dgs/quantization/wrapper.py,sha256=cyXqfJgo9b3fS7DYXxOk5LmQudvrEhweOebF
20
20
  reduced_3dgs/shculling/__init__.py,sha256=nP2BejDCUdCmJNRbg0hfhHREO6jyZXwIcRiw6ttVgqo,149
21
21
  reduced_3dgs/shculling/gaussian_model.py,sha256=f8QWaL09vaV9Tcf6Dngjg_Fmk1wTQPAjWhuhI_N02Y8,2877
22
22
  reduced_3dgs/shculling/trainer.py,sha256=9hwR77djhZpyf-URhwKHjnLbe0ZAOS-DIw58RzkcHXQ,6369
23
- reduced_3dgs/simple_knn/_C.cp311-win_amd64.pyd,sha256=8Wj2LMNDF2ge-kdpiM0bdS0VQ6eS_kqGwetWnfJdroE,1263616
24
- reduced_3dgs-1.8.19.dist-info/licenses/LICENSE.md,sha256=LQ4_LAqlncGkg_mQy5ykMAFtQDSPB0eKmIEtBut0yjw,4916
25
- reduced_3dgs-1.8.19.dist-info/METADATA,sha256=j7c3qbf3ewfPBjNgY_toNbiEYmTpTdGZ4g4zoiipjUk,13015
26
- reduced_3dgs-1.8.19.dist-info/WHEEL,sha256=ZhKniLpVlRfVU2a9ty7N0kTvsYDNee6K-jhM1zk8cMw,101
27
- reduced_3dgs-1.8.19.dist-info/top_level.txt,sha256=PpU5aT3-baSCdqCtTaZknoB32H93UeKCkYDkRCCZMEI,13
28
- reduced_3dgs-1.8.19.dist-info/RECORD,,
23
+ reduced_3dgs/simple_knn/_C.cp311-win_amd64.pyd,sha256=I8xj0hehTO_hy7d1MLZlQRa9plXq7JkTbCs_yxYSQOA,1263616
24
+ reduced_3dgs-1.9.0.dist-info/licenses/LICENSE.md,sha256=LQ4_LAqlncGkg_mQy5ykMAFtQDSPB0eKmIEtBut0yjw,4916
25
+ reduced_3dgs-1.9.0.dist-info/METADATA,sha256=aUf_QT29FqRs9fkUn8fVi2BpHWfdeGYnB9bxA-hYVgQ,13014
26
+ reduced_3dgs-1.9.0.dist-info/WHEEL,sha256=ZhKniLpVlRfVU2a9ty7N0kTvsYDNee6K-jhM1zk8cMw,101
27
+ reduced_3dgs-1.9.0.dist-info/top_level.txt,sha256=PpU5aT3-baSCdqCtTaZknoB32H93UeKCkYDkRCCZMEI,13
28
+ reduced_3dgs-1.9.0.dist-info/RECORD,,