reduced-3dgs 1.10.3__tar.gz → 1.10.5__tar.gz
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.
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/PKG-INFO +1 -1
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/reduced_3dgs/combinations.py +8 -2
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/reduced_3dgs/importance/combinations.py +8 -2
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/reduced_3dgs/pruning/combinations.py +8 -2
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/reduced_3dgs/quantization/quantizer.py +19 -9
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/reduced_3dgs.egg-info/PKG-INFO +1 -1
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/setup.py +1 -1
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/LICENSE.md +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/README.md +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/reduced_3dgs/__init__.py +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/reduced_3dgs/importance/__init__.py +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/reduced_3dgs/importance/trainer.py +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/reduced_3dgs/prepare.py +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/reduced_3dgs/pruning/__init__.py +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/reduced_3dgs/pruning/trainer.py +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/reduced_3dgs/quantization/__init__.py +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/reduced_3dgs/quantization/abc.py +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/reduced_3dgs/quantization/exclude_zeros.py +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/reduced_3dgs/quantization/wrapper.py +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/reduced_3dgs/quantize.py +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/reduced_3dgs/shculling/__init__.py +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/reduced_3dgs/shculling/gaussian_model.py +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/reduced_3dgs/shculling/trainer.py +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/reduced_3dgs/train.py +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/reduced_3dgs.egg-info/SOURCES.txt +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/reduced_3dgs.egg-info/dependency_links.txt +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/reduced_3dgs.egg-info/requires.txt +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/reduced_3dgs.egg-info/top_level.txt +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/setup.cfg +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/submodules/diff-gaussian-rasterization/cuda_rasterizer/backward.cu +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/submodules/diff-gaussian-rasterization/cuda_rasterizer/forward.cu +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/submodules/diff-gaussian-rasterization/cuda_rasterizer/rasterizer_impl.cu +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/submodules/diff-gaussian-rasterization/diff_gaussian_rasterization/__init__.py +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/submodules/diff-gaussian-rasterization/ext.cpp +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/submodules/diff-gaussian-rasterization/rasterize_points.cu +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/submodules/diff-gaussian-rasterization/reduced_3dgs/kmeans.cu +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/submodules/diff-gaussian-rasterization/reduced_3dgs/redundancy_score.cu +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/submodules/diff-gaussian-rasterization/reduced_3dgs/sh_culling.cu +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/submodules/diff-gaussian-rasterization/reduced_3dgs.cu +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/submodules/gaussian-importance/cuda_rasterizer/backward.cu +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/submodules/gaussian-importance/cuda_rasterizer/forward.cu +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/submodules/gaussian-importance/cuda_rasterizer/rasterizer_impl.cu +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/submodules/gaussian-importance/diff_gaussian_rasterization/__init__.py +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/submodules/gaussian-importance/ext.cpp +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/submodules/gaussian-importance/rasterize_points.cu +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/submodules/simple-knn/ext.cpp +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/submodules/simple-knn/simple_knn.cu +0 -0
- {reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/submodules/simple-knn/spatial.cu +0 -0
|
@@ -97,11 +97,17 @@ def BaseFullPrunerInDensifyTrainer(
|
|
|
97
97
|
|
|
98
98
|
|
|
99
99
|
def DepthFullPruningTrainer(model: GaussianModel, scene_extent: float, dataset: TrainableCameraDataset, *args, **kwargs):
|
|
100
|
-
return DepthTrainerWrapper(
|
|
100
|
+
return DepthTrainerWrapper(
|
|
101
|
+
BaseFullPruningTrainer,
|
|
102
|
+
model, scene_extent, dataset,
|
|
103
|
+
*args, **kwargs)
|
|
101
104
|
|
|
102
105
|
|
|
103
106
|
def DepthFullPrunerInDensifyTrainer(model: GaussianModel, scene_extent: float, dataset: TrainableCameraDataset, *args, **kwargs):
|
|
104
|
-
return DepthTrainerWrapper(
|
|
107
|
+
return DepthTrainerWrapper(
|
|
108
|
+
BaseFullPrunerInDensifyTrainer,
|
|
109
|
+
model, scene_extent, dataset,
|
|
110
|
+
*args, **kwargs)
|
|
105
111
|
|
|
106
112
|
|
|
107
113
|
def OpacityResetPruningTrainer(
|
|
@@ -52,11 +52,17 @@ def BaseImportancePrunerInDensifyTrainer(
|
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
def DepthImportancePruningTrainer(model: GaussianModel, scene_extent: float, dataset: TrainableCameraDataset, *args, **kwargs):
|
|
55
|
-
return DepthTrainerWrapper(
|
|
55
|
+
return DepthTrainerWrapper(
|
|
56
|
+
BaseImportancePruningTrainer,
|
|
57
|
+
model, scene_extent, dataset,
|
|
58
|
+
*args, **kwargs)
|
|
56
59
|
|
|
57
60
|
|
|
58
61
|
def DepthImportancePrunerInDensifyTrainer(model: GaussianModel, scene_extent: float, dataset: TrainableCameraDataset, *args, **kwargs):
|
|
59
|
-
return DepthTrainerWrapper(
|
|
62
|
+
return DepthTrainerWrapper(
|
|
63
|
+
BaseImportancePrunerInDensifyTrainer,
|
|
64
|
+
model, scene_extent, dataset,
|
|
65
|
+
*args, **kwargs)
|
|
60
66
|
|
|
61
67
|
|
|
62
68
|
ImportancePruningTrainer = DepthImportancePruningTrainer
|
|
@@ -54,11 +54,17 @@ def BasePrunerInDensifyTrainer(
|
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
def DepthPruningTrainer(model: GaussianModel, scene_extent: float, dataset: TrainableCameraDataset, *args, **kwargs):
|
|
57
|
-
return DepthTrainerWrapper(
|
|
57
|
+
return DepthTrainerWrapper(
|
|
58
|
+
BasePruningTrainer,
|
|
59
|
+
model, scene_extent, dataset,
|
|
60
|
+
*args, **kwargs)
|
|
58
61
|
|
|
59
62
|
|
|
60
63
|
def DepthPrunerInDensifyTrainer(model: GaussianModel, scene_extent: float, dataset: TrainableCameraDataset, *args, **kwargs):
|
|
61
|
-
return DepthTrainerWrapper(
|
|
64
|
+
return DepthTrainerWrapper(
|
|
65
|
+
BasePrunerInDensifyTrainer,
|
|
66
|
+
model, scene_extent, dataset,
|
|
67
|
+
*args, **kwargs)
|
|
62
68
|
|
|
63
69
|
|
|
64
70
|
PruningTrainer = DepthPruningTrainer
|
|
@@ -262,36 +262,46 @@ class VectorQuantizer(AbstractQuantizer):
|
|
|
262
262
|
|
|
263
263
|
PlyData([el, *cb]).write(ply_path)
|
|
264
264
|
|
|
265
|
-
def
|
|
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=
|
|
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(
|
|
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=
|
|
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(
|
|
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
|
-
|
|
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)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/submodules/diff-gaussian-rasterization/reduced_3dgs.cu
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{reduced_3dgs-1.10.3 → reduced_3dgs-1.10.5}/submodules/gaussian-importance/rasterize_points.cu
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|