feature-4dgs 1.0.0__py3-none-any.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.
- feature_4dgs/__init__.py +5 -0
- feature_4dgs/extractor/__init__.py +3 -0
- feature_4dgs/extractor/dataset.py +61 -0
- feature_4dgs/extractor/extractor.py +19 -0
- feature_4dgs/extractor/wrapper.py +43 -0
- feature_4dgs/inherent.py +34 -0
- feature_4dgs/prepare.py +95 -0
- feature_4dgs/registry.py +33 -0
- feature_4dgs/train.py +157 -0
- feature_4dgs/vggt/__init__.py +1 -0
- feature_4dgs/vggt/extractor.py +45 -0
- feature_4dgs/vggt/vggt.py +37 -0
- feature_4dgs-1.0.0.dist-info/METADATA +335 -0
- feature_4dgs-1.0.0.dist-info/RECORD +17 -0
- feature_4dgs-1.0.0.dist-info/WHEEL +5 -0
- feature_4dgs-1.0.0.dist-info/licenses/LICENSE +201 -0
- feature_4dgs-1.0.0.dist-info/top_level.txt +1 -0
feature_4dgs/__init__.py
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
from .extractor import AbstractSequenceFeatureExtractor, SequenceFeatureCameraDataset
|
|
2
|
+
from .extractor import InherentSequenceFeatureExtractor, InherentSequenceFeatureCameraDataset
|
|
3
|
+
from .registry import register_extractor_decoder, get_available_extractor_decoders, build_extractor_decoder
|
|
4
|
+
from . import inherent # noqa: F401 — registers feature_3dgs extractors as inherent
|
|
5
|
+
from . import vggt # noqa: F401 — registers feature_3dgs extractors as inherent
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from typing import List
|
|
3
|
+
|
|
4
|
+
import tqdm
|
|
5
|
+
import torch
|
|
6
|
+
|
|
7
|
+
from gaussian_splatting.dataset import CameraDataset, TrainableCameraDataset
|
|
8
|
+
from feature_3dgs.extractor import FeatureCameraDataset, TrainableFeatureCameraDataset
|
|
9
|
+
|
|
10
|
+
from .extractor import AbstractSequenceFeatureExtractor
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class SequenceFeatureCameraDataset:
|
|
14
|
+
"""A sequence of per-timestep :class:`FeatureCameraDataset`.
|
|
15
|
+
|
|
16
|
+
Takes multiple :class:`CameraDataset` objects (one per timestep) plus a
|
|
17
|
+
shared :class:`AbstractSequenceFeatureExtractor`, and wraps each of them
|
|
18
|
+
as a :class:`FeatureCameraDataset` (or :class:`TrainableFeatureCameraDataset`
|
|
19
|
+
when the input is a :class:`TrainableCameraDataset`). Indexing the
|
|
20
|
+
sequence with ``seq[t]`` returns the ``t``-th timestep's feature dataset.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
def __init__(self, cameras_list: List[CameraDataset], extractor: AbstractSequenceFeatureExtractor, cache_device=None):
|
|
24
|
+
self.extractor = extractor
|
|
25
|
+
self.cache_device = cache_device
|
|
26
|
+
self.datasets: List[FeatureCameraDataset] = []
|
|
27
|
+
for cameras in cameras_list:
|
|
28
|
+
if isinstance(cameras, TrainableCameraDataset):
|
|
29
|
+
cls = TrainableFeatureCameraDataset
|
|
30
|
+
elif isinstance(cameras, CameraDataset):
|
|
31
|
+
cls = FeatureCameraDataset
|
|
32
|
+
else:
|
|
33
|
+
raise ValueError(f"Invalid camera dataset type: {type(cameras)}")
|
|
34
|
+
self.datasets.append(cls(cameras=cameras, extractor=extractor, cache_device=cache_device))
|
|
35
|
+
|
|
36
|
+
def to(self, device) -> 'SequenceFeatureCameraDataset':
|
|
37
|
+
for dataset in self.datasets:
|
|
38
|
+
dataset.to(device)
|
|
39
|
+
return self
|
|
40
|
+
|
|
41
|
+
def __len__(self) -> int:
|
|
42
|
+
return len(self.datasets)
|
|
43
|
+
|
|
44
|
+
def __getitem__(self, idx) -> FeatureCameraDataset:
|
|
45
|
+
return self.datasets[idx]
|
|
46
|
+
|
|
47
|
+
@property
|
|
48
|
+
def embed_dim(self) -> int:
|
|
49
|
+
return self.datasets[0].embed_dim
|
|
50
|
+
|
|
51
|
+
def preload_cache(self):
|
|
52
|
+
sequences = ((camera.ground_truth_image for camera in dataset.cameras) for dataset in self.datasets)
|
|
53
|
+
for dataset, feature_maps in zip(self.datasets, self.extractor.extract_sequence_all(sequences)):
|
|
54
|
+
dataset.feature_map_cache = []
|
|
55
|
+
for feature_map in tqdm.tqdm(feature_maps, total=len(dataset.cameras), desc=f"Preloading feature maps"):
|
|
56
|
+
if dataset.cache_device is not None:
|
|
57
|
+
feature_map = feature_map.to(dataset.cache_device)
|
|
58
|
+
dataset.feature_map_cache.append(feature_map)
|
|
59
|
+
torch.cuda.empty_cache()
|
|
60
|
+
del dataset.extractor
|
|
61
|
+
del self.extractor
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from collections.abc import Iterable, Iterator
|
|
2
|
+
|
|
3
|
+
import torch
|
|
4
|
+
|
|
5
|
+
from feature_3dgs.extractor import AbstractFeatureExtractor
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class AbstractSequenceFeatureExtractor(AbstractFeatureExtractor):
|
|
9
|
+
"""A feature extractor that can also process a sequence of image streams.
|
|
10
|
+
|
|
11
|
+
A "sequence" here is an iterable of per-timestep iterables of images.
|
|
12
|
+
The default :meth:`extract_sequence_all` simply dispatches to
|
|
13
|
+
:meth:`extract_all` for each timestep; subclasses may override it to
|
|
14
|
+
perform cross-timestep batching, caching or scheduling.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
def extract_sequence_all(self, sequences: Iterable[Iterable[torch.Tensor]]) -> Iterator[Iterator[torch.Tensor]]:
|
|
18
|
+
for sequence in sequences:
|
|
19
|
+
yield self.extract_all(sequence)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
from collections.abc import Iterable, Iterator
|
|
2
|
+
from typing import List
|
|
3
|
+
|
|
4
|
+
import torch
|
|
5
|
+
|
|
6
|
+
from gaussian_splatting.dataset import CameraDataset
|
|
7
|
+
from feature_3dgs.extractor import AbstractFeatureExtractor
|
|
8
|
+
|
|
9
|
+
from .extractor import AbstractSequenceFeatureExtractor
|
|
10
|
+
from .dataset import SequenceFeatureCameraDataset
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class InherentSequenceFeatureExtractor(AbstractSequenceFeatureExtractor):
|
|
14
|
+
"""Lift any :class:`AbstractFeatureExtractor` into the
|
|
15
|
+
:class:`AbstractSequenceFeatureExtractor` interface by simply forwarding
|
|
16
|
+
``__call__``, ``to`` and ``extract_all`` to the wrapped extractor.
|
|
17
|
+
|
|
18
|
+
The default :meth:`extract_sequence_all` from the base class then calls
|
|
19
|
+
``extract_all`` once per timestep.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
def __init__(self, extractor: AbstractFeatureExtractor):
|
|
23
|
+
self.extractor = extractor
|
|
24
|
+
|
|
25
|
+
def __call__(self, image: torch.Tensor) -> torch.Tensor:
|
|
26
|
+
return self.extractor(image)
|
|
27
|
+
|
|
28
|
+
def to(self, device) -> 'InherentSequenceFeatureExtractor':
|
|
29
|
+
self.extractor = self.extractor.to(device)
|
|
30
|
+
return self
|
|
31
|
+
|
|
32
|
+
def extract_all(self, images: Iterable[torch.Tensor]) -> Iterator[torch.Tensor]:
|
|
33
|
+
return self.extractor.extract_all(images)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class InherentSequenceFeatureCameraDataset(SequenceFeatureCameraDataset):
|
|
37
|
+
"""Convenience subclass of :class:`SequenceFeatureCameraDataset` that
|
|
38
|
+
accepts a plain :class:`AbstractFeatureExtractor` and wraps it with a
|
|
39
|
+
:class:`InherentSequenceFeatureExtractor` before constructing the sequence.
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
def __init__(self, cameras_list: List[CameraDataset], extractor: AbstractFeatureExtractor, cache_device=None):
|
|
43
|
+
super().__init__(cameras_list=cameras_list, extractor=InherentSequenceFeatureExtractor(extractor), cache_device=cache_device)
|
feature_4dgs/inherent.py
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"""Re-register every extractor-decoder from ``feature_3dgs`` into the
|
|
2
|
+
``feature_4dgs`` registry by wrapping each extractor with
|
|
3
|
+
:class:`InherentSequenceFeatureExtractor`.
|
|
4
|
+
|
|
5
|
+
Names are suffixed with ``-inherent`` to distinguish them from potential
|
|
6
|
+
native sequence implementations.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from typing import Tuple
|
|
10
|
+
|
|
11
|
+
import feature_3dgs # noqa: F401 — triggers feature_3dgs's own registrations
|
|
12
|
+
from feature_3dgs.registry import ExtractorDecoderFactory, REGISTRY
|
|
13
|
+
from feature_3dgs.decoder import AbstractTrainableDecoder
|
|
14
|
+
|
|
15
|
+
from .extractor import AbstractSequenceFeatureExtractor, InherentSequenceFeatureExtractor
|
|
16
|
+
from .registry import register_extractor_decoder
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class InherentSequenceExtractorDecoderFactory:
|
|
20
|
+
"""Wraps a ``feature_3dgs`` :class:`ExtractorDecoderFactory` so that
|
|
21
|
+
calling it returns an :class:`InherentSequenceFeatureExtractor`
|
|
22
|
+
paired with the original decoder.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
def __init__(self, factory: ExtractorDecoderFactory):
|
|
26
|
+
self.factory = factory
|
|
27
|
+
|
|
28
|
+
def __call__(self, embed_dim: int, *args, **kwargs) -> Tuple[AbstractSequenceFeatureExtractor, AbstractTrainableDecoder]:
|
|
29
|
+
extractor, decoder = self.factory(embed_dim, *args, **kwargs)
|
|
30
|
+
return InherentSequenceFeatureExtractor(extractor), decoder
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
for name, factory in REGISTRY.items():
|
|
34
|
+
register_extractor_decoder(f"{name}-inherent", InherentSequenceExtractorDecoderFactory(factory))
|
feature_4dgs/prepare.py
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import tempfile
|
|
3
|
+
from typing import List, Tuple
|
|
4
|
+
|
|
5
|
+
import torch
|
|
6
|
+
from gaussian_splatting.dataset import CameraDataset
|
|
7
|
+
from gaussian_splatting.prepare import prepare_dataset
|
|
8
|
+
from feature_3dgs.decoder import AbstractTrainableDecoder
|
|
9
|
+
from feature_3dgs.prepare import prepare_gaussians
|
|
10
|
+
from feature_3dgs import SemanticGaussianModel
|
|
11
|
+
from .registry import build_extractor_decoder
|
|
12
|
+
|
|
13
|
+
from .extractor import SequenceFeatureCameraDataset
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def prepare_datasets(sources: List[str], device: str, trainable_camera: bool = False, load_cameras: List[str] = None, load_mask=True, load_depth=True) -> List[CameraDataset]:
|
|
17
|
+
"""Load one :class:`CameraDataset` per timestep by calling
|
|
18
|
+
:func:`gaussian_splatting.prepare.prepare_dataset` for each source.
|
|
19
|
+
"""
|
|
20
|
+
load_cameras = load_cameras if load_cameras is not None else [None] * len(sources)
|
|
21
|
+
assert len(load_cameras) == len(sources), "len(load_cameras) must equal len(sources)"
|
|
22
|
+
return [
|
|
23
|
+
prepare_dataset(
|
|
24
|
+
source=source, device=device,
|
|
25
|
+
trainable_camera=trainable_camera, load_camera=load_camera,
|
|
26
|
+
load_mask=load_mask, load_depth=load_depth,
|
|
27
|
+
)
|
|
28
|
+
for source, load_camera in zip(sources, load_cameras)
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def prepare_datasets_and_decoder(
|
|
33
|
+
name: str, sources: List[str], embed_dim: int, device: str, dataset_cache_device: str = None,
|
|
34
|
+
trainable_camera: bool = False, load_cameras: List[str] = None, load_mask=True, load_depth=True,
|
|
35
|
+
preload_cache: bool = True, configs={},
|
|
36
|
+
) -> Tuple[SequenceFeatureCameraDataset, AbstractTrainableDecoder]:
|
|
37
|
+
"""Prepare a :class:`SequenceFeatureCameraDataset` and a shared decoder.
|
|
38
|
+
|
|
39
|
+
All timesteps share a single extractor/decoder pair. The
|
|
40
|
+
:class:`AbstractSequenceFeatureExtractor` returned by
|
|
41
|
+
:func:`build_extractor_decoder` is used directly.
|
|
42
|
+
"""
|
|
43
|
+
cameras_list = prepare_datasets(
|
|
44
|
+
sources=sources, device=device,
|
|
45
|
+
trainable_camera=trainable_camera, load_cameras=load_cameras,
|
|
46
|
+
load_mask=load_mask, load_depth=load_depth,
|
|
47
|
+
)
|
|
48
|
+
extractor, decoder = build_extractor_decoder(
|
|
49
|
+
name=name, embed_dim=embed_dim, **configs
|
|
50
|
+
)
|
|
51
|
+
datasets = SequenceFeatureCameraDataset(cameras_list=cameras_list, extractor=extractor, cache_device=dataset_cache_device).to(device)
|
|
52
|
+
if preload_cache:
|
|
53
|
+
datasets.preload_cache()
|
|
54
|
+
return datasets, decoder
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def prepare_gaussians_sequence(
|
|
58
|
+
decoder: AbstractTrainableDecoder, sh_degree: int,
|
|
59
|
+
sources: List[str], datasets: SequenceFeatureCameraDataset, device: str,
|
|
60
|
+
trainable_camera: bool = False, load_plys: List[str] = None, load_semantic: bool = True,
|
|
61
|
+
load_decoder: str = None,
|
|
62
|
+
) -> List[SemanticGaussianModel]:
|
|
63
|
+
"""Prepare one :class:`SemanticGaussianModel` per timestep, ensuring a
|
|
64
|
+
consistent decoder initialisation across all frames.
|
|
65
|
+
|
|
66
|
+
After the first frame is prepared its decoder state is saved to a temporary
|
|
67
|
+
file. Every subsequent frame that would go through ``init_semantic``
|
|
68
|
+
(i.e. ``not load_ply or not load_semantic``) receives that file via the
|
|
69
|
+
``load_decoder`` parameter so all frames start from the same weights.
|
|
70
|
+
"""
|
|
71
|
+
load_plys = load_plys if load_plys is not None else [None] * len(sources)
|
|
72
|
+
assert len(load_plys) == len(sources), "len(load_plys) must equal len(sources)"
|
|
73
|
+
|
|
74
|
+
first_gaussians = prepare_gaussians(
|
|
75
|
+
decoder=decoder, sh_degree=sh_degree, source=sources[0], dataset=datasets[0],
|
|
76
|
+
device=device, trainable_camera=trainable_camera,
|
|
77
|
+
load_ply=load_plys[0], load_semantic=load_semantic,
|
|
78
|
+
load_decoder=load_decoder,
|
|
79
|
+
)
|
|
80
|
+
gaussians_list: List[SemanticGaussianModel] = [first_gaussians]
|
|
81
|
+
|
|
82
|
+
with tempfile.TemporaryDirectory(prefix="feature4dgs_decoder_") as tmp_decoder_dir:
|
|
83
|
+
tmp_decoder_path = os.path.join(tmp_decoder_dir, "init")
|
|
84
|
+
torch.save(decoder.state_dict(), tmp_decoder_path + ".decoder.pt")
|
|
85
|
+
|
|
86
|
+
for source, dataset, load_ply in zip(sources[1:], datasets[1:], load_plys[1:]):
|
|
87
|
+
load_decoder = tmp_decoder_path if (not load_ply or not load_semantic) else None
|
|
88
|
+
gaussians = prepare_gaussians(
|
|
89
|
+
decoder=decoder, sh_degree=sh_degree, source=source, dataset=dataset, device=device,
|
|
90
|
+
trainable_camera=trainable_camera, load_ply=load_ply, load_semantic=load_semantic,
|
|
91
|
+
load_decoder=load_decoder,
|
|
92
|
+
)
|
|
93
|
+
gaussians_list.append(gaussians)
|
|
94
|
+
|
|
95
|
+
return gaussians_list
|
feature_4dgs/registry.py
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from typing import Tuple, Protocol
|
|
2
|
+
|
|
3
|
+
from feature_3dgs.decoder import AbstractTrainableDecoder
|
|
4
|
+
from .extractor import AbstractSequenceFeatureExtractor
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class SequenceExtractorDecoderFactory(Protocol):
|
|
8
|
+
def __call__(self, embed_dim: int, *args: object, **kwargs: object) -> tuple[AbstractSequenceFeatureExtractor, AbstractTrainableDecoder]: ...
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
REGISTRY: dict[str, SequenceExtractorDecoderFactory] = {}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def register_extractor_decoder(name: str, factory: SequenceExtractorDecoderFactory) -> None:
|
|
15
|
+
"""Register an (AbstractSequenceFeatureExtractor, AbstractTrainableDecoder) factory under *name*."""
|
|
16
|
+
if name in REGISTRY:
|
|
17
|
+
raise ValueError(f"Sequence extractor-decoder combination '{name}' is already registered.")
|
|
18
|
+
REGISTRY[name] = factory
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def get_available_extractor_decoders() -> list[str]:
|
|
22
|
+
"""Return the names of all registered sequence extractor-decoder combinations."""
|
|
23
|
+
return list(REGISTRY.keys())
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def build_extractor_decoder(name: str, embed_dim: int, **configs) -> Tuple[AbstractSequenceFeatureExtractor, AbstractTrainableDecoder]:
|
|
27
|
+
"""Build an (AbstractSequenceFeatureExtractor, AbstractTrainableDecoder) pair by name."""
|
|
28
|
+
if name not in REGISTRY:
|
|
29
|
+
raise KeyError(
|
|
30
|
+
f"Sequence extractor-decoder combination '{name}' not found. "
|
|
31
|
+
f"Available: {get_available_extractor_decoders()}"
|
|
32
|
+
)
|
|
33
|
+
return REGISTRY[name](embed_dim, **configs)
|
feature_4dgs/train.py
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import random
|
|
3
|
+
import shutil
|
|
4
|
+
from typing import List, Tuple
|
|
5
|
+
|
|
6
|
+
import torch
|
|
7
|
+
from tqdm import tqdm
|
|
8
|
+
|
|
9
|
+
from gaussian_splatting.trainer import AbstractTrainer
|
|
10
|
+
from gaussian_splatting.train import save_cfg_args
|
|
11
|
+
from gaussian_splatting.utils import psnr
|
|
12
|
+
from feature_3dgs import SemanticGaussianModel
|
|
13
|
+
from feature_3dgs.prepare import prepare_trainer, modes
|
|
14
|
+
|
|
15
|
+
from .extractor import SequenceFeatureCameraDataset
|
|
16
|
+
from .prepare import prepare_datasets_and_decoder, prepare_gaussians_sequence
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def prepare_training(
|
|
20
|
+
name: str, sh_degree: int, mode: str, sources: List[str], embed_dim: int,
|
|
21
|
+
device: str, dataset_cache_device: str = None,
|
|
22
|
+
trainable_camera: bool = False, load_plys: List[str] = None, load_decoder: str = None, load_cameras: List[str] = None,
|
|
23
|
+
load_mask=True, load_depth=True, load_semantic: bool = True,
|
|
24
|
+
preload_cache: bool = True, configs={}, extractor_configs={},
|
|
25
|
+
) -> Tuple[SequenceFeatureCameraDataset, List[SemanticGaussianModel], List[AbstractTrainer]]:
|
|
26
|
+
"""Prepare a sequence dataset, per-timestep gaussians and trainers.
|
|
27
|
+
|
|
28
|
+
All timesteps share a single decoder (owned by the extractor/decoder
|
|
29
|
+
factory) that is attached to every :class:`SemanticGaussianModel`.
|
|
30
|
+
"""
|
|
31
|
+
datasets, decoder = prepare_datasets_and_decoder(
|
|
32
|
+
name=name, sources=sources, embed_dim=embed_dim, device=device, dataset_cache_device=dataset_cache_device,
|
|
33
|
+
trainable_camera=trainable_camera, load_cameras=load_cameras,
|
|
34
|
+
load_mask=load_mask, load_depth=load_depth, preload_cache=preload_cache, configs=extractor_configs,
|
|
35
|
+
)
|
|
36
|
+
gaussians_list = prepare_gaussians_sequence(
|
|
37
|
+
decoder=decoder, sh_degree=sh_degree, sources=sources, datasets=datasets, device=device,
|
|
38
|
+
trainable_camera=trainable_camera, load_plys=load_plys, load_semantic=load_semantic, load_decoder=load_decoder,)
|
|
39
|
+
trainers = [prepare_trainer(
|
|
40
|
+
gaussians=gaussians, dataset=dataset, mode=mode,
|
|
41
|
+
trainable_camera=trainable_camera, configs=configs,
|
|
42
|
+
) for gaussians, dataset in zip(gaussians_list, datasets)]
|
|
43
|
+
return datasets, gaussians_list, trainers
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def training(datasets: SequenceFeatureCameraDataset, gaussians_list: List[SemanticGaussianModel], trainers: List[AbstractTrainer], destinations: List[str], iteration: int, save_iterations: List[int], empty_cache_every_step=False):
|
|
47
|
+
assert len(datasets) == len(gaussians_list) == len(trainers) == len(destinations), \
|
|
48
|
+
"datasets, gaussians_list, trainers and destinations must have the same length (number of timesteps)"
|
|
49
|
+
for destination in destinations:
|
|
50
|
+
shutil.rmtree(os.path.join(destination, "point_cloud"), ignore_errors=True)
|
|
51
|
+
pbar = tqdm(range(1, iteration+1), dynamic_ncols=True, desc="Training")
|
|
52
|
+
epoch = [list(range(len(dataset))) for dataset in datasets]
|
|
53
|
+
epoch_psnr = [torch.empty(3, 0) for _ in range(len(datasets))]
|
|
54
|
+
epoch_maskpsnr = [torch.empty(3, 0) for _ in range(len(datasets))]
|
|
55
|
+
ema_loss_for_log = 0.0
|
|
56
|
+
avg_psnr_for_log = 0.0
|
|
57
|
+
avg_maskpsnr_for_log = 0.0
|
|
58
|
+
avg_psnrs = [None] * len(datasets)
|
|
59
|
+
avg_maskpsnrs = [None] * len(datasets)
|
|
60
|
+
for step in pbar:
|
|
61
|
+
step_loss_sum = 0.0
|
|
62
|
+
for i in random.sample(range(len(datasets)), len(datasets)):
|
|
63
|
+
dataset, trainer = datasets[i], trainers[i]
|
|
64
|
+
epoch_idx = step % len(dataset)
|
|
65
|
+
if epoch_idx == 0:
|
|
66
|
+
avg_psnrs[i] = epoch_psnr[i].mean().item() if epoch_psnr[i].numel() > 0 else None
|
|
67
|
+
avg_maskpsnrs[i] = epoch_maskpsnr[i].mean().item() if epoch_maskpsnr[i].numel() > 0 else None
|
|
68
|
+
valid_psnrs = [v for v in avg_psnrs if v is not None]
|
|
69
|
+
valid_maskpsnrs = [v for v in avg_maskpsnrs if v is not None]
|
|
70
|
+
avg_psnr_for_log = sum(valid_psnrs) / len(valid_psnrs) if valid_psnrs else 0.0
|
|
71
|
+
avg_maskpsnr_for_log = sum(valid_maskpsnrs) / len(valid_maskpsnrs) if valid_maskpsnrs else 0.0
|
|
72
|
+
epoch_psnr[i] = torch.empty(3, 0)
|
|
73
|
+
epoch_maskpsnr[i] = torch.empty(3, 0)
|
|
74
|
+
random.shuffle(epoch[i])
|
|
75
|
+
idx = epoch[i][epoch_idx]
|
|
76
|
+
loss, out = trainer.step(dataset[idx])
|
|
77
|
+
with torch.no_grad():
|
|
78
|
+
ground_truth_image = dataset[idx].ground_truth_image
|
|
79
|
+
rendered_image = out["render"].detach()
|
|
80
|
+
epoch_psnr[i] = torch.concat([epoch_psnr[i], psnr(rendered_image, ground_truth_image).cpu()], dim=1)
|
|
81
|
+
if dataset[idx].ground_truth_image_mask is not None:
|
|
82
|
+
ground_truth_maskimage = ground_truth_image * dataset[idx].ground_truth_image_mask
|
|
83
|
+
rendered_maskimage = rendered_image * dataset[idx].ground_truth_image_mask
|
|
84
|
+
epoch_maskpsnr[i] = torch.cat([epoch_maskpsnr[i], psnr(rendered_maskimage, ground_truth_maskimage).cpu()], dim=1)
|
|
85
|
+
step_loss_sum += loss.item()
|
|
86
|
+
del loss, out
|
|
87
|
+
ema_loss_for_log = 0.4 * (step_loss_sum / len(datasets)) + 0.6 * ema_loss_for_log
|
|
88
|
+
if empty_cache_every_step:
|
|
89
|
+
torch.cuda.empty_cache()
|
|
90
|
+
if step % 10 == 0:
|
|
91
|
+
postfix = {'loss': ema_loss_for_log, 'psnr': avg_psnr_for_log, 'masked psnr': avg_maskpsnr_for_log, 'n': sum(g._xyz.shape[0] for g in gaussians_list)}
|
|
92
|
+
if avg_maskpsnr_for_log <= 0:
|
|
93
|
+
del postfix['masked psnr']
|
|
94
|
+
pbar.set_postfix(postfix)
|
|
95
|
+
if step in save_iterations:
|
|
96
|
+
for destination, gaussians, dataset in zip(destinations, gaussians_list, datasets):
|
|
97
|
+
save_path = os.path.join(destination, "point_cloud", "iteration_" + str(step))
|
|
98
|
+
os.makedirs(save_path, exist_ok=True)
|
|
99
|
+
gaussians.save_ply(os.path.join(save_path, "point_cloud.ply"))
|
|
100
|
+
dataset.save_cameras(os.path.join(destination, "cameras.json"))
|
|
101
|
+
for destination, gaussians, dataset in zip(destinations, gaussians_list, datasets):
|
|
102
|
+
save_path = os.path.join(destination, "point_cloud", "iteration_" + str(iteration))
|
|
103
|
+
os.makedirs(save_path, exist_ok=True)
|
|
104
|
+
gaussians.save_ply(os.path.join(save_path, "point_cloud.ply"))
|
|
105
|
+
dataset.save_cameras(os.path.join(destination, "cameras.json"))
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
if __name__ == "__main__":
|
|
109
|
+
from argparse import ArgumentParser
|
|
110
|
+
parser = ArgumentParser()
|
|
111
|
+
parser.add_argument("--sh_degree", default=3, type=int)
|
|
112
|
+
parser.add_argument("--name", required=True, type=str)
|
|
113
|
+
parser.add_argument("--embed_dim", required=True, type=int)
|
|
114
|
+
parser.add_argument("-s", "--sources", required=True, nargs='+', type=str)
|
|
115
|
+
parser.add_argument("-d", "--destinations", required=True, nargs='+', type=str)
|
|
116
|
+
parser.add_argument("-i", "--iteration", default=30000, type=int)
|
|
117
|
+
parser.add_argument("-l", "--load_plys", default=None, nargs='+', type=str)
|
|
118
|
+
parser.add_argument("--load_decoder", default=None, type=str)
|
|
119
|
+
parser.add_argument("--load_cameras", default=None, nargs='+', type=str)
|
|
120
|
+
parser.add_argument("--no_image_mask", action="store_true")
|
|
121
|
+
parser.add_argument("--no_depth_data", action="store_true")
|
|
122
|
+
parser.add_argument("--no_load_semantic", action="store_true")
|
|
123
|
+
parser.add_argument("--mode", choices=sorted(modes.keys()), default="base")
|
|
124
|
+
parser.add_argument("--save_iterations", nargs="+", type=int, default=[7000, 30000])
|
|
125
|
+
parser.add_argument("--device", default="cuda", type=str)
|
|
126
|
+
parser.add_argument("--dataset_cache_device", default="cpu", type=str)
|
|
127
|
+
parser.add_argument("--no_preload_dataset_cache", action="store_true")
|
|
128
|
+
parser.add_argument("--empty_cache_every_step", action='store_true')
|
|
129
|
+
parser.add_argument("-o", "--option", default=[], action='append', type=str)
|
|
130
|
+
parser.add_argument("-e", "--option_extractor", default=[], action='append', type=str)
|
|
131
|
+
args = parser.parse_args()
|
|
132
|
+
assert len(args.destinations) == len(args.sources), "len(destinations) must equal len(sources)"
|
|
133
|
+
if args.load_plys is not None:
|
|
134
|
+
assert len(args.load_plys) == len(args.sources), "len(load_plys) must equal len(sources)"
|
|
135
|
+
if args.load_cameras is not None:
|
|
136
|
+
assert len(args.load_cameras) == len(args.sources), "len(load_cameras) must equal len(sources)"
|
|
137
|
+
for destination, source in zip(args.destinations, args.sources):
|
|
138
|
+
save_cfg_args(destination, args.sh_degree, source)
|
|
139
|
+
torch.autograd.set_detect_anomaly(False)
|
|
140
|
+
|
|
141
|
+
configs = {o.split("=", 1)[0]: eval(o.split("=", 1)[1]) for o in args.option}
|
|
142
|
+
extractor_configs = {o.split("=", 1)[0]: eval(o.split("=", 1)[1]) for o in args.option_extractor}
|
|
143
|
+
datasets, gaussians_list, trainers = prepare_training(
|
|
144
|
+
name=args.name, sh_degree=args.sh_degree, mode=args.mode,
|
|
145
|
+
sources=args.sources, embed_dim=args.embed_dim,
|
|
146
|
+
device=args.device, dataset_cache_device=args.dataset_cache_device,
|
|
147
|
+
trainable_camera="camera" in args.mode,
|
|
148
|
+
load_plys=args.load_plys, load_decoder=args.load_decoder, load_cameras=args.load_cameras,
|
|
149
|
+
load_mask=not args.no_image_mask, load_depth=not args.no_depth_data, load_semantic=not args.no_load_semantic,
|
|
150
|
+
preload_cache=not args.no_preload_dataset_cache, configs=configs, extractor_configs=extractor_configs)
|
|
151
|
+
for dataset in datasets:
|
|
152
|
+
dataset.save_cameras(os.path.join(args.destinations[0], "cameras.json"))
|
|
153
|
+
torch.cuda.empty_cache()
|
|
154
|
+
training(
|
|
155
|
+
datasets=datasets, gaussians_list=gaussians_list, trainers=trainers,
|
|
156
|
+
destinations=args.destinations, iteration=args.iteration, save_iterations=args.save_iterations,
|
|
157
|
+
empty_cache_every_step=args.empty_cache_every_step)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .vggt import VGGTSequenceExtractor
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
from collections.abc import Iterable, Iterator
|
|
2
|
+
from itertools import islice
|
|
3
|
+
|
|
4
|
+
import torch
|
|
5
|
+
|
|
6
|
+
from feature_3dgs.vggt.extractor import VGGTExtractor
|
|
7
|
+
from feature_3dgs.vggt.track import VGGTrackExtractor
|
|
8
|
+
from feature_4dgs.extractor import InherentSequenceFeatureExtractor
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class VGGTSequenceExtractor(InherentSequenceFeatureExtractor):
|
|
12
|
+
"""VGGT-aware sequence extractor.
|
|
13
|
+
|
|
14
|
+
Wraps a :class:`VGGTExtractor` via :class:`InherentSequenceFeatureExtractor`
|
|
15
|
+
and overrides :meth:`extract_sequence_all` to flatten all per-timestep
|
|
16
|
+
images into a single call to :meth:`extract_all`, allowing VGGT's
|
|
17
|
+
multi-view aggregator to see every frame at once.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
def __init__(self, extractor: VGGTExtractor):
|
|
21
|
+
assert isinstance(extractor, VGGTExtractor), "VGGTSequenceExtractor requires a VGGTExtractor instance."
|
|
22
|
+
super().__init__(extractor)
|
|
23
|
+
|
|
24
|
+
def extract_sequence_all(self, sequences: Iterable[Iterable[torch.Tensor]]) -> Iterator[Iterator[torch.Tensor]]:
|
|
25
|
+
flatten: list[torch.Tensor] = []
|
|
26
|
+
counts: list[int] = []
|
|
27
|
+
for sequence in sequences:
|
|
28
|
+
sequence = list(sequence)
|
|
29
|
+
counts.append(len(sequence))
|
|
30
|
+
flatten.extend(sequence)
|
|
31
|
+
results = self.extract_all(flatten)
|
|
32
|
+
for count in counts:
|
|
33
|
+
yield islice(results, count)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class VGGTrackSequenceExtractor(VGGTSequenceExtractor):
|
|
37
|
+
"""VGGTrack-aware sequence extractor.
|
|
38
|
+
|
|
39
|
+
Identical to :class:`VGGTSequenceExtractor` but asserts the wrapped
|
|
40
|
+
extractor is a :class:`VGGTrackExtractor`.
|
|
41
|
+
"""
|
|
42
|
+
|
|
43
|
+
def __init__(self, extractor: VGGTrackExtractor):
|
|
44
|
+
assert isinstance(extractor, VGGTrackExtractor), "VGGTrackSequenceExtractor requires a VGGTrackExtractor instance."
|
|
45
|
+
super().__init__(extractor)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
from typing import Tuple
|
|
2
|
+
|
|
3
|
+
from feature_3dgs.decoder import AbstractTrainableDecoder
|
|
4
|
+
from feature_3dgs.vggt.vggt import build_factory as build_factory_inherent
|
|
5
|
+
from feature_3dgs.vggt.vggt import build_track_factory as build_track_factory_inherent
|
|
6
|
+
|
|
7
|
+
from feature_4dgs.extractor import AbstractSequenceFeatureExtractor
|
|
8
|
+
from feature_4dgs.registry import register_extractor_decoder
|
|
9
|
+
|
|
10
|
+
from .extractor import VGGTSequenceExtractor, VGGTrackSequenceExtractor
|
|
11
|
+
|
|
12
|
+
MODEL_VGGT = "vggt"
|
|
13
|
+
MODEL_VGGTRACK = "vggtrack"
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def build_factory():
|
|
17
|
+
factory_inherent = build_factory_inherent()
|
|
18
|
+
|
|
19
|
+
def factory(embed_dim: int, **configs,) -> Tuple[AbstractSequenceFeatureExtractor, AbstractTrainableDecoder]:
|
|
20
|
+
extractor, decoder = factory_inherent(embed_dim, **configs)
|
|
21
|
+
return VGGTSequenceExtractor(extractor), decoder
|
|
22
|
+
|
|
23
|
+
return factory
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def build_track_factory():
|
|
27
|
+
factory_inherent = build_track_factory_inherent()
|
|
28
|
+
|
|
29
|
+
def factory(embed_dim: int, **configs,) -> Tuple[AbstractSequenceFeatureExtractor, AbstractTrainableDecoder]:
|
|
30
|
+
extractor, decoder = factory_inherent(embed_dim, **configs)
|
|
31
|
+
return VGGTrackSequenceExtractor(extractor), decoder
|
|
32
|
+
|
|
33
|
+
return factory
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
register_extractor_decoder(MODEL_VGGT, build_factory())
|
|
37
|
+
register_extractor_decoder(MODEL_VGGTRACK, build_track_factory())
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: feature_4dgs
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Packaged Python training code for sequence-aware Feature 3D Gaussian Splatting
|
|
5
|
+
Home-page: https://github.com/yindaheng98/feature-4dgs
|
|
6
|
+
Author: yindaheng98
|
|
7
|
+
Author-email: yindaheng98@gmail.com
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Requires-Dist: feature-3dgs
|
|
12
|
+
Dynamic: author
|
|
13
|
+
Dynamic: author-email
|
|
14
|
+
Dynamic: classifier
|
|
15
|
+
Dynamic: description
|
|
16
|
+
Dynamic: description-content-type
|
|
17
|
+
Dynamic: home-page
|
|
18
|
+
Dynamic: license-file
|
|
19
|
+
Dynamic: requires-dist
|
|
20
|
+
Dynamic: summary
|
|
21
|
+
|
|
22
|
+
# Sequence-Aware Feature Training for Feature 3DGS (Packaged Python Version)
|
|
23
|
+
|
|
24
|
+
This repo is the **sequence-aware Python training extension for Feature 3DGS**, built on top of [`feature-3dgs`](https://github.com/yindaheng98/feature-3dgs) and [`gaussian-splatting`](https://github.com/yindaheng98/gaussian-splatting).
|
|
25
|
+
It extends the packaged Feature 3DGS Extractor-Decoder architecture from single scenes to multi-timestep 4D / dynamic-scene training.
|
|
26
|
+
|
|
27
|
+
Each timestep owns an independent `SemanticGaussianModel`, while the whole sequence shares a single learnable **Decoder** and a sequence-capable **Extractor**. This keeps per-frame Gaussian geometry separate while aligning all timesteps into one semantic feature space. Existing Feature 3DGS extractors can be reused through an inherent wrapper, and VGGT-based extractors can process all sequence images in one multi-view batch.
|
|
28
|
+
|
|
29
|
+
## Features
|
|
30
|
+
|
|
31
|
+
* [x] Organised as a standard Python package with `pip install` support
|
|
32
|
+
* [x] Sequence-aware Extractor-Decoder registry for 4D / multi-timestep training
|
|
33
|
+
* [x] Reuses all `feature_3dgs` extractors through `*-inherent` registrations
|
|
34
|
+
* [x] Shared decoder initialisation across all timesteps for a consistent feature space
|
|
35
|
+
* [x] All training modes inherited from Feature 3DGS: base, densify, camera, camera-densify
|
|
36
|
+
|
|
37
|
+
## Install
|
|
38
|
+
|
|
39
|
+
### Prerequisites
|
|
40
|
+
|
|
41
|
+
* [Pytorch](https://pytorch.org/) (>= v2.4 recommended)
|
|
42
|
+
* [CUDA Toolkit](https://developer.nvidia.com/cuda-12-4-0-download-archive) (12.4 recommended, match with PyTorch version)
|
|
43
|
+
* [`feature-3dgs`](https://github.com/yindaheng98/feature-3dgs) (>= v1.10.0)
|
|
44
|
+
|
|
45
|
+
Install `feature-3dgs` dependencies used by the inherited extractors:
|
|
46
|
+
```shell
|
|
47
|
+
pip install wheel setuptools
|
|
48
|
+
pip install --upgrade git+https://github.com/yindaheng98/feature-3dgs.git@main --no-build-isolation
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
(Optional) If you have trouble with [`gaussian-splatting`](https://github.com/yindaheng98/gaussian-splatting), try to install it from source:
|
|
52
|
+
```sh
|
|
53
|
+
pip install wheel setuptools
|
|
54
|
+
pip install --upgrade git+https://github.com/yindaheng98/gaussian-splatting.git@master --no-build-isolation
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## PyPI Install
|
|
58
|
+
|
|
59
|
+
```shell
|
|
60
|
+
pip install --upgrade feature-4dgs
|
|
61
|
+
```
|
|
62
|
+
or
|
|
63
|
+
build latest from source:
|
|
64
|
+
```shell
|
|
65
|
+
pip install wheel setuptools
|
|
66
|
+
pip install --upgrade git+https://github.com/yindaheng98/feature-4dgs.git@main --no-build-isolation
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Development Install
|
|
70
|
+
|
|
71
|
+
```shell
|
|
72
|
+
git clone --recursive https://github.com/yindaheng98/feature-4dgs.git
|
|
73
|
+
cd feature-4dgs
|
|
74
|
+
pip install --target . --upgrade . --no-deps
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Download Checkpoints
|
|
78
|
+
|
|
79
|
+
Follow the checkpoint instructions in [`feature-3dgs`](https://github.com/yindaheng98/feature-3dgs). This package reuses the same inherited extractors and checkpoint layout.
|
|
80
|
+
|
|
81
|
+
## Command-Line Usage
|
|
82
|
+
|
|
83
|
+
### List Registered Extractor-Decoders
|
|
84
|
+
|
|
85
|
+
Verify that `feature_4dgs` can import and register sequence extractors:
|
|
86
|
+
|
|
87
|
+
```shell
|
|
88
|
+
python -c "import feature_4dgs; print(feature_4dgs.get_available_extractor_decoders())"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Every extractor registered by `feature_3dgs` is also available with an `-inherent` suffix, for example `dinov3_vitl16-inherent`.
|
|
92
|
+
|
|
93
|
+
### Train
|
|
94
|
+
|
|
95
|
+
```shell
|
|
96
|
+
python -m feature_4dgs.train \
|
|
97
|
+
--name dinov3_vitl16-inherent --embed_dim 32 \
|
|
98
|
+
-s data/sequence/frame_000 data/sequence/frame_001 data/sequence/frame_002 \
|
|
99
|
+
-d output/sequence/frame_000-dinov3_vitl16 output/sequence/frame_001-dinov3_vitl16 output/sequence/frame_002-dinov3_vitl16 \
|
|
100
|
+
-i 30000 \
|
|
101
|
+
--mode densify \
|
|
102
|
+
-e checkpoint_dir="'checkpoints'"
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Each `-s/--sources` entry is one timestep's COLMAP / Gaussian Splatting scene directory, and each `-d/--destinations` entry is the matching output directory. The number of destinations must equal the number of sources.
|
|
106
|
+
|
|
107
|
+
### Resume From Saved Point Clouds
|
|
108
|
+
|
|
109
|
+
```shell
|
|
110
|
+
python -m feature_4dgs.train \
|
|
111
|
+
--name dinov3_vitl16-inherent --embed_dim 32 \
|
|
112
|
+
-s data/sequence/frame_000 data/sequence/frame_001 \
|
|
113
|
+
-d output/sequence/frame_000-dinov3_vitl16 output/sequence/frame_001-dinov3_vitl16 \
|
|
114
|
+
-l output/sequence/frame_000-dinov3_vitl16/point_cloud/iteration_30000/point_cloud.ply \
|
|
115
|
+
output/sequence/frame_001-dinov3_vitl16/point_cloud/iteration_30000/point_cloud.ply \
|
|
116
|
+
--load_decoder output/sequence/frame_000-dinov3_vitl16/point_cloud/iteration_30000/point_cloud.ply \
|
|
117
|
+
-i 60000
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
The trainer saves each timestep independently under its destination directory, while `cameras.json` and semantic sidecar files follow the same layout as Feature 3DGS.
|
|
121
|
+
|
|
122
|
+
## API Usage
|
|
123
|
+
|
|
124
|
+
### Dataset & Decoder
|
|
125
|
+
|
|
126
|
+
```python
|
|
127
|
+
from feature_4dgs.prepare import prepare_datasets_and_decoder
|
|
128
|
+
|
|
129
|
+
datasets, decoder = prepare_datasets_and_decoder(
|
|
130
|
+
name="dinov3_vitl16-inherent", # registered sequence extractor-decoder name
|
|
131
|
+
sources=[
|
|
132
|
+
"data/sequence/frame_000",
|
|
133
|
+
"data/sequence/frame_001",
|
|
134
|
+
],
|
|
135
|
+
embed_dim=32,
|
|
136
|
+
device="cuda",
|
|
137
|
+
dataset_cache_device="cpu",
|
|
138
|
+
configs={"checkpoint_dir": "checkpoints"},
|
|
139
|
+
)
|
|
140
|
+
# datasets is a SequenceFeatureCameraDataset; datasets[t] is a FeatureCameraDataset
|
|
141
|
+
# decoder is shared by all timesteps
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Gaussian Sequence
|
|
145
|
+
|
|
146
|
+
```python
|
|
147
|
+
from feature_4dgs.prepare import prepare_gaussians_sequence
|
|
148
|
+
|
|
149
|
+
gaussians_list = prepare_gaussians_sequence(
|
|
150
|
+
decoder=decoder,
|
|
151
|
+
sh_degree=3,
|
|
152
|
+
sources=[
|
|
153
|
+
"data/sequence/frame_000",
|
|
154
|
+
"data/sequence/frame_001",
|
|
155
|
+
],
|
|
156
|
+
datasets=datasets,
|
|
157
|
+
device="cuda",
|
|
158
|
+
)
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
`prepare_gaussians_sequence` creates one `SemanticGaussianModel` per timestep. The first model initialises the shared decoder, then subsequent models load that decoder state so every frame starts in the same feature space.
|
|
162
|
+
|
|
163
|
+
### Training
|
|
164
|
+
|
|
165
|
+
```python
|
|
166
|
+
from feature_4dgs.train import prepare_training, training
|
|
167
|
+
|
|
168
|
+
datasets, gaussians_list, trainers = prepare_training(
|
|
169
|
+
name="dinov3_vitl16-inherent",
|
|
170
|
+
sh_degree=3,
|
|
171
|
+
mode="densify",
|
|
172
|
+
sources=["data/sequence/frame_000", "data/sequence/frame_001"],
|
|
173
|
+
embed_dim=32,
|
|
174
|
+
device="cuda",
|
|
175
|
+
extractor_configs={"checkpoint_dir": "checkpoints"},
|
|
176
|
+
)
|
|
177
|
+
training(
|
|
178
|
+
datasets=datasets,
|
|
179
|
+
gaussians_list=gaussians_list,
|
|
180
|
+
trainers=trainers,
|
|
181
|
+
destinations=["output/frame_000-dinov3_vitl16", "output/frame_001-dinov3_vitl16"],
|
|
182
|
+
iteration=30000,
|
|
183
|
+
save_iterations=[7000, 30000],
|
|
184
|
+
)
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Inference
|
|
188
|
+
|
|
189
|
+
```python
|
|
190
|
+
import torch
|
|
191
|
+
|
|
192
|
+
with torch.no_grad():
|
|
193
|
+
for dataset, gaussians in zip(datasets, gaussians_list):
|
|
194
|
+
for camera in dataset:
|
|
195
|
+
out = gaussians(camera)
|
|
196
|
+
rgb = out["render"] # (3, H, W)
|
|
197
|
+
feat = out["feature_map"] # decoded, extractor-aligned
|
|
198
|
+
feat_enc = out["feature_map_encoded"] # raw rasterised embeddings
|
|
199
|
+
|
|
200
|
+
semantics = gaussians.get_semantics # per-Gaussian semantic features
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Save & Load
|
|
204
|
+
|
|
205
|
+
```python
|
|
206
|
+
gaussians_list[0].save_ply("output/frame_000/point_cloud.ply")
|
|
207
|
+
# also saves point_cloud.ply.semantic.pt and point_cloud.ply.decoder.pt
|
|
208
|
+
|
|
209
|
+
gaussians_list[0].load_ply("output/frame_000/point_cloud.ply")
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## Design: Sequence Extractor & Shared Decoder
|
|
213
|
+
|
|
214
|
+
The core abstraction extends Feature 3DGS by decoupling **how features are extracted across a sequence** from **how rasterised embeddings are decoded**.
|
|
215
|
+
|
|
216
|
+
### Sequence Extractor (`AbstractSequenceFeatureExtractor`)
|
|
217
|
+
|
|
218
|
+
The sequence extractor is a frozen foundation model wrapper that can process multiple timesteps. It inherits the single-image `AbstractFeatureExtractor` interface and adds `extract_sequence_all`:
|
|
219
|
+
|
|
220
|
+
```
|
|
221
|
+
Timestep image streams ──► Sequence Extractor (frozen) ──► Per-timestep feature maps
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
The default implementation simply calls `extract_all` once per timestep. Native sequence extractors may override this to batch or aggregate images across time.
|
|
225
|
+
|
|
226
|
+
### Shared Decoder (`AbstractTrainableDecoder`)
|
|
227
|
+
|
|
228
|
+
The decoder is the same trainable Feature 3DGS decoder shared by every timestep:
|
|
229
|
+
|
|
230
|
+
```
|
|
231
|
+
Frame 0 Gaussians ──┐
|
|
232
|
+
Frame 1 Gaussians ──┼──► Shared Decoder ──► Extractor-aligned feature maps
|
|
233
|
+
Frame 2 Gaussians ──┘
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
Sharing the decoder keeps all per-frame Gaussian embeddings aligned to a common feature space, while each timestep still has its own geometry, opacity, colour and encoded semantic tensors.
|
|
237
|
+
|
|
238
|
+
### Inherent Extractors
|
|
239
|
+
|
|
240
|
+
Any `feature_3dgs` extractor-decoder factory can be lifted into this sequence-aware package by wrapping its extractor with `InherentSequenceFeatureExtractor`. These registrations are suffixed with `-inherent`:
|
|
241
|
+
|
|
242
|
+
```shell
|
|
243
|
+
python -m feature_4dgs.train --name dinov3_vitl16-inherent --embed_dim 32 \
|
|
244
|
+
-s data/frame_000 data/frame_001 \
|
|
245
|
+
-d output/frame_000 output/frame_001
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### Native VGGT Sequence Extractors
|
|
249
|
+
|
|
250
|
+
`VGGTSequenceExtractor` and `VGGTrackSequenceExtractor` flatten all timestep image streams into one call to VGGT's multi-view extractor, then split the result back per timestep. This lets VGGT use cross-view context over the full sequence before distillation starts.
|
|
251
|
+
|
|
252
|
+
## Extending: Adding a New Sequence Foundation Model
|
|
253
|
+
|
|
254
|
+
The project uses the same **auto-registration** pattern as Feature 3DGS. To add support for a new sequence model (e.g. a hypothetical `MyModel`), follow the VGGT implementation as a reference:
|
|
255
|
+
|
|
256
|
+
### Step 1: Implement the Sequence Extractor
|
|
257
|
+
|
|
258
|
+
Create `feature_4dgs/mymodel/extractor.py`:
|
|
259
|
+
|
|
260
|
+
```python
|
|
261
|
+
import torch
|
|
262
|
+
from feature_4dgs.extractor import AbstractSequenceFeatureExtractor
|
|
263
|
+
|
|
264
|
+
class MyModelSequenceExtractor(AbstractSequenceFeatureExtractor):
|
|
265
|
+
def __init__(self, model, ...):
|
|
266
|
+
self.model = model
|
|
267
|
+
self.model.eval()
|
|
268
|
+
|
|
269
|
+
@torch.no_grad()
|
|
270
|
+
def __call__(self, image: torch.Tensor) -> torch.Tensor:
|
|
271
|
+
# image: (C, H, W) in [0, 1]
|
|
272
|
+
# Return: (D, H', W') feature map
|
|
273
|
+
...
|
|
274
|
+
|
|
275
|
+
def extract_sequence_all(self, sequences):
|
|
276
|
+
# Optional override for cross-timestep batching or aggregation.
|
|
277
|
+
...
|
|
278
|
+
|
|
279
|
+
def to(self, device) -> "MyModelSequenceExtractor":
|
|
280
|
+
self.model.to(device)
|
|
281
|
+
return self
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
### Step 2: Reuse or Implement the Decoder
|
|
285
|
+
|
|
286
|
+
Most models can reuse a `feature_3dgs` decoder such as `LinearDecoder`, or a model-specific decoder from Feature 3DGS. The key constraint is unchanged: `decode_feature_map` must output the same channel count and spatial size as the sequence extractor's feature maps.
|
|
287
|
+
|
|
288
|
+
### Step 3: Register via Factory
|
|
289
|
+
|
|
290
|
+
Create `feature_4dgs/mymodel/registry.py`:
|
|
291
|
+
|
|
292
|
+
```python
|
|
293
|
+
from feature_3dgs.decoder import LinearDecoder
|
|
294
|
+
from feature_4dgs.registry import register_extractor_decoder
|
|
295
|
+
from .extractor import MyModelSequenceExtractor
|
|
296
|
+
|
|
297
|
+
FEATURE_DIM = 768
|
|
298
|
+
|
|
299
|
+
def factory(embed_dim: int, **configs):
|
|
300
|
+
extractor = MyModelSequenceExtractor(...)
|
|
301
|
+
decoder = LinearDecoder(
|
|
302
|
+
in_channels=embed_dim,
|
|
303
|
+
out_channels=FEATURE_DIM,
|
|
304
|
+
)
|
|
305
|
+
return extractor, decoder
|
|
306
|
+
|
|
307
|
+
register_extractor_decoder("mymodel", factory)
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### Step 4: Trigger Registration on Import
|
|
311
|
+
|
|
312
|
+
Create `feature_4dgs/mymodel/__init__.py`:
|
|
313
|
+
|
|
314
|
+
```python
|
|
315
|
+
from . import registry # triggers register_extractor_decoder() at import time
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
Then add the import in `feature_4dgs/__init__.py`:
|
|
319
|
+
|
|
320
|
+
```python
|
|
321
|
+
from . import mymodel # auto-registers "mymodel"
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
After these steps, the new model is available everywhere:
|
|
325
|
+
|
|
326
|
+
```shell
|
|
327
|
+
python -m feature_4dgs.train --name mymodel --embed_dim 32 \
|
|
328
|
+
-s data/frame_000 data/frame_001 \
|
|
329
|
+
-d output/frame_000-mymodel output/frame_001-mymodel \
|
|
330
|
+
-i 30000
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
## Acknowledgement
|
|
334
|
+
|
|
335
|
+
This repo is developed based on [Feature 3DGS](https://github.com/ShijieZhou-UCLA/feature-3dgs), [feature-3dgs (packaged)](https://github.com/yindaheng98/feature-3dgs), [3D Gaussian Splatting](https://github.com/graphdeco-inria/gaussian-splatting), and [gaussian-splatting (packaged)](https://github.com/yindaheng98/gaussian-splatting). Many thanks to the authors for open-sourcing their codebases.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
feature_4dgs/__init__.py,sha256=wTi5YD0tlnmevcmRSAaHBWNNW9lJBaHv3H5wSaR8uV8,460
|
|
2
|
+
feature_4dgs/inherent.py,sha256=VEGlojGt4ggvevi3Oc41IokZtjkrvYebSeP4iUDwHiM,1389
|
|
3
|
+
feature_4dgs/prepare.py,sha256=JZ_J9YFOLki58_k4A3lTWxipoue2QKOS65cTe_QePUw,4453
|
|
4
|
+
feature_4dgs/registry.py,sha256=PAH04I0gAQCC0M6Ny_3In_dJ-JsNWXqCJ20BVYRnyYc,1416
|
|
5
|
+
feature_4dgs/train.py,sha256=KkIcqtDiJ-2IyJ9wn3rOhbx3zo7lNRZ0308zL09wiNQ,9538
|
|
6
|
+
feature_4dgs/extractor/__init__.py,sha256=7i1RIQ6mjjletrfAyvPXh-x1u5Itt3e4eVuk-AkLfW8,198
|
|
7
|
+
feature_4dgs/extractor/dataset.py,sha256=ePgdRSZDtyaQQxKrTvgaUSv4JB0YfeJOUeEAXUmVbSM,2569
|
|
8
|
+
feature_4dgs/extractor/extractor.py,sha256=BRtHg9HZUDg7B5y7lqhMMCpTvu0vMWZtf5h2iUKXsKM,748
|
|
9
|
+
feature_4dgs/extractor/wrapper.py,sha256=zlt8dYGhlEJQNndpkFyxwbAGKnywGB3pGgNKkm5bsL8,1743
|
|
10
|
+
feature_4dgs/vggt/__init__.py,sha256=6XlId6vlXwOqHL1vbFndPYPl27SDWzCkPmN8kSfI7xA,40
|
|
11
|
+
feature_4dgs/vggt/extractor.py,sha256=q76SDWw08BB6A8gq7W5jPN96rWMXZvdYqHgtGiCEHoI,1756
|
|
12
|
+
feature_4dgs/vggt/vggt.py,sha256=EmREBFSsBfPGeim3QdWnU8ODjBIKOcpOfkidLd7RQOQ,1300
|
|
13
|
+
feature_4dgs-1.0.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
14
|
+
feature_4dgs-1.0.0.dist-info/METADATA,sha256=Y4RQfAcJk0Nhi8T2CpvEy0ggowBeV6L3Qr6E3ldTa_M,12211
|
|
15
|
+
feature_4dgs-1.0.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
16
|
+
feature_4dgs-1.0.0.dist-info/top_level.txt,sha256=Ty98EzA6_RBj5x3GOykm8Qkjgtqsd2ILYedPkTth-WA,13
|
|
17
|
+
feature_4dgs-1.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
feature_4dgs
|