depth-estimation 0.0.6__tar.gz → 0.0.7__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.
- {depth_estimation-0.0.6/src/depth_estimation.egg-info → depth_estimation-0.0.7}/PKG-INFO +4 -4
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/README.md +3 -3
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/pyproject.toml +1 -1
- depth_estimation-0.0.7/src/depth_estimation/__init__.py +63 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/models/auto/processing_auto.py +2 -2
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/models/depth_anything_v1/__init__.py +15 -2
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/models/depth_anything_v2/__init__.py +15 -2
- depth_estimation-0.0.7/src/depth_estimation/models/depth_anything_v3/__init__.py +50 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/models/depth_pro/__init__.py +15 -2
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/models/marigold_dc/__init__.py +15 -2
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/models/midas/__init__.py +15 -2
- depth_estimation-0.0.7/src/depth_estimation/models/moge/__init__.py +27 -0
- depth_estimation-0.0.7/src/depth_estimation/models/moge/configuration_moge.py +98 -0
- depth_estimation-0.0.7/src/depth_estimation/models/moge/modeling_moge.py +1503 -0
- depth_estimation-0.0.7/src/depth_estimation/models/omnivggt/__init__.py +27 -0
- depth_estimation-0.0.7/src/depth_estimation/models/omnivggt/configuration_omnivggt.py +62 -0
- depth_estimation-0.0.7/src/depth_estimation/models/omnivggt/modeling_omnivggt.py +1357 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/models/pixel_perfect_depth/__init__.py +15 -2
- depth_estimation-0.0.7/src/depth_estimation/models/vggt/__init__.py +27 -0
- depth_estimation-0.0.7/src/depth_estimation/models/vggt/configuration_vggt.py +71 -0
- depth_estimation-0.0.7/src/depth_estimation/models/vggt/modeling_vggt.py +1133 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/models/zoedepth/__init__.py +15 -2
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/registry.py +6 -1
- {depth_estimation-0.0.6 → depth_estimation-0.0.7/src/depth_estimation.egg-info}/PKG-INFO +4 -4
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation.egg-info/SOURCES.txt +9 -0
- depth_estimation-0.0.6/src/depth_estimation/__init__.py +0 -40
- depth_estimation-0.0.6/src/depth_estimation/models/depth_anything_v3/__init__.py +0 -29
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/LICENSE +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/setup.cfg +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/cli.py +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/configuration_utils.py +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/modeling_utils.py +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/models/__init__.py +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/models/auto/__init__.py +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/models/auto/modeling_auto.py +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/models/depth_anything_v1/configuration_depth_anything_v1.py +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/models/depth_anything_v1/modeling_depth_anything_v1.py +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/models/depth_anything_v2/configuration_depth_anything_v2.py +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/models/depth_anything_v2/modeling_depth_anything_v2.py +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/models/depth_anything_v3/configuration_depth_anything_v3.py +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/models/depth_anything_v3/modeling_depth_anything_v3.py +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/models/depth_pro/configuration_depth_pro.py +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/models/depth_pro/modeling_depth_pro.py +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/models/marigold_dc/configuration_marigold_dc.py +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/models/marigold_dc/modeling_marigold_dc.py +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/models/midas/configuration_midas.py +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/models/midas/modeling_midas.py +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/models/pixel_perfect_depth/configuration_ppd.py +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/models/pixel_perfect_depth/modeling_ppd.py +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/models/zoedepth/configuration_zoedepth.py +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/models/zoedepth/modeling_zoedepth.py +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/output.py +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/pipeline_utils.py +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/pipelines/__init__.py +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/pipelines/depth_estimation.py +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/processing_utils.py +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation.egg-info/dependency_links.txt +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation.egg-info/entry_points.txt +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation.egg-info/requires.txt +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation.egg-info/top_level.txt +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/tests/test_auto.py +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/tests/test_config.py +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/tests/test_model.py +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/tests/test_pipeline.py +0 -0
- {depth_estimation-0.0.6 → depth_estimation-0.0.7}/tests/test_processor.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: depth_estimation
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.7
|
|
4
4
|
Summary: A Transformers-style Python library for monocular depth estimation
|
|
5
5
|
Author: shriarul5273
|
|
6
6
|
License-Expression: MIT
|
|
@@ -49,7 +49,7 @@ Dynamic: license-file
|
|
|
49
49
|
|
|
50
50
|
A **Python library** for monocular depth estimation.
|
|
51
51
|
|
|
52
|
-
Provides a unified, modular API for running inference, comparing, and integrating depth estimation models — supporting **
|
|
52
|
+
Provides a unified, modular API for running inference, comparing, and integrating depth estimation models — supporting **12 model families** with **28 variants** and designed to accommodate new models with minimal friction.
|
|
53
53
|
|
|
54
54
|
## Installation
|
|
55
55
|
|
|
@@ -87,7 +87,7 @@ meta = result.metadata # dict with model info
|
|
|
87
87
|
```python
|
|
88
88
|
from depth_estimation import AutoDepthModel, AutoProcessor
|
|
89
89
|
|
|
90
|
-
# Works with any of the
|
|
90
|
+
# Works with any of the 25 supported variants
|
|
91
91
|
model = AutoDepthModel.from_pretrained("zoedepth")
|
|
92
92
|
processor = AutoProcessor.from_pretrained("zoedepth")
|
|
93
93
|
|
|
@@ -108,7 +108,7 @@ for r in results:
|
|
|
108
108
|
|
|
109
109
|
## Supported Models
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
12 model families · 28 variants — see [docs/models.md](https://github.com/shriarul5273/depth_estimation/blob/main/docs/models.md) for the full list.
|
|
112
112
|
|
|
113
113
|
## Architecture
|
|
114
114
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A **Python library** for monocular depth estimation.
|
|
4
4
|
|
|
5
|
-
Provides a unified, modular API for running inference, comparing, and integrating depth estimation models — supporting **
|
|
5
|
+
Provides a unified, modular API for running inference, comparing, and integrating depth estimation models — supporting **12 model families** with **28 variants** and designed to accommodate new models with minimal friction.
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
@@ -40,7 +40,7 @@ meta = result.metadata # dict with model info
|
|
|
40
40
|
```python
|
|
41
41
|
from depth_estimation import AutoDepthModel, AutoProcessor
|
|
42
42
|
|
|
43
|
-
# Works with any of the
|
|
43
|
+
# Works with any of the 25 supported variants
|
|
44
44
|
model = AutoDepthModel.from_pretrained("zoedepth")
|
|
45
45
|
processor = AutoProcessor.from_pretrained("zoedepth")
|
|
46
46
|
|
|
@@ -61,7 +61,7 @@ for r in results:
|
|
|
61
61
|
|
|
62
62
|
## Supported Models
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
12 model families · 28 variants — see [docs/models.md](https://github.com/shriarul5273/depth_estimation/blob/main/docs/models.md) for the full list.
|
|
65
65
|
|
|
66
66
|
## Architecture
|
|
67
67
|
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"""
|
|
2
|
+
depth_estimation — A Transformers-style Python library for monocular depth estimation.
|
|
3
|
+
|
|
4
|
+
Provides a unified, modular API for running, comparing, and integrating
|
|
5
|
+
depth estimation models.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from .output import DepthOutput
|
|
9
|
+
from .configuration_utils import BaseDepthConfig
|
|
10
|
+
from .registry import MODEL_REGISTRY
|
|
11
|
+
|
|
12
|
+
# Auto classes
|
|
13
|
+
from .models.auto import AutoDepthModel, AutoProcessor
|
|
14
|
+
|
|
15
|
+
# Ensure model modules are imported so they self-register.
|
|
16
|
+
# These are now torch-free — modeling classes are loaded lazily on first use.
|
|
17
|
+
from .models import depth_anything_v1 # noqa: F401
|
|
18
|
+
from .models import depth_anything_v2 # noqa: F401
|
|
19
|
+
from .models import depth_anything_v3 # noqa: F401
|
|
20
|
+
from .models import zoedepth # noqa: F401
|
|
21
|
+
from .models import midas # noqa: F401
|
|
22
|
+
from .models import depth_pro # noqa: F401
|
|
23
|
+
from .models import pixel_perfect_depth # noqa: F401
|
|
24
|
+
from .models import marigold_dc # noqa: F401
|
|
25
|
+
from .models import moge # noqa: F401
|
|
26
|
+
from .models import omnivggt # noqa: F401
|
|
27
|
+
from .models import vggt # noqa: F401
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def __getattr__(name):
|
|
31
|
+
"""Defer torch-heavy imports until first use."""
|
|
32
|
+
if name == "BaseDepthModel":
|
|
33
|
+
from .modeling_utils import BaseDepthModel
|
|
34
|
+
globals()["BaseDepthModel"] = BaseDepthModel
|
|
35
|
+
return BaseDepthModel
|
|
36
|
+
if name == "DepthProcessor":
|
|
37
|
+
from .processing_utils import DepthProcessor
|
|
38
|
+
globals()["DepthProcessor"] = DepthProcessor
|
|
39
|
+
return DepthProcessor
|
|
40
|
+
if name == "DepthPipeline":
|
|
41
|
+
from .pipeline_utils import DepthPipeline
|
|
42
|
+
globals()["DepthPipeline"] = DepthPipeline
|
|
43
|
+
return DepthPipeline
|
|
44
|
+
if name == "pipeline":
|
|
45
|
+
from .pipeline_utils import pipeline
|
|
46
|
+
globals()["pipeline"] = pipeline
|
|
47
|
+
return pipeline
|
|
48
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
__all__ = [
|
|
52
|
+
"DepthOutput",
|
|
53
|
+
"BaseDepthConfig",
|
|
54
|
+
"BaseDepthModel",
|
|
55
|
+
"DepthProcessor",
|
|
56
|
+
"DepthPipeline",
|
|
57
|
+
"pipeline",
|
|
58
|
+
"AutoDepthModel",
|
|
59
|
+
"AutoProcessor",
|
|
60
|
+
"MODEL_REGISTRY",
|
|
61
|
+
]
|
|
62
|
+
|
|
63
|
+
__version__ = "0.0.7"
|
|
@@ -5,7 +5,6 @@ AutoProcessor — Automatic processor resolution via the global registry.
|
|
|
5
5
|
from typing import Any, Optional
|
|
6
6
|
|
|
7
7
|
from ...registry import MODEL_REGISTRY
|
|
8
|
-
from ...processing_utils import DepthProcessor
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
class AutoProcessor:
|
|
@@ -25,7 +24,7 @@ class AutoProcessor:
|
|
|
25
24
|
)
|
|
26
25
|
|
|
27
26
|
@staticmethod
|
|
28
|
-
def from_pretrained(model_id: str, **kwargs: Any)
|
|
27
|
+
def from_pretrained(model_id: str, **kwargs: Any):
|
|
29
28
|
"""Create a DepthProcessor configured for the given model.
|
|
30
29
|
|
|
31
30
|
Args:
|
|
@@ -46,4 +45,5 @@ class AutoProcessor:
|
|
|
46
45
|
else:
|
|
47
46
|
config = config_cls()
|
|
48
47
|
|
|
48
|
+
from ...processing_utils import DepthProcessor
|
|
49
49
|
return DepthProcessor.from_config(config)
|
|
@@ -8,17 +8,30 @@ from .configuration_depth_anything_v1 import (
|
|
|
8
8
|
DepthAnythingV1Config,
|
|
9
9
|
_V1_VARIANT_MAP,
|
|
10
10
|
)
|
|
11
|
-
from .modeling_depth_anything_v1 import DepthAnythingV1Model
|
|
12
11
|
from ...registry import MODEL_REGISTRY
|
|
13
12
|
|
|
13
|
+
|
|
14
|
+
def _load_model_cls():
|
|
15
|
+
from .modeling_depth_anything_v1 import DepthAnythingV1Model
|
|
16
|
+
return DepthAnythingV1Model
|
|
17
|
+
|
|
18
|
+
|
|
14
19
|
# Self-register with the global registry
|
|
15
20
|
MODEL_REGISTRY.register(
|
|
16
21
|
model_type="depth-anything-v1",
|
|
17
22
|
config_cls=DepthAnythingV1Config,
|
|
18
|
-
model_cls=
|
|
23
|
+
model_cls=_load_model_cls,
|
|
19
24
|
variant_ids=list(_V1_VARIANT_MAP.keys()),
|
|
20
25
|
)
|
|
21
26
|
|
|
27
|
+
|
|
28
|
+
def __getattr__(name):
|
|
29
|
+
if name == "DepthAnythingV1Model":
|
|
30
|
+
from .modeling_depth_anything_v1 import DepthAnythingV1Model
|
|
31
|
+
return DepthAnythingV1Model
|
|
32
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
33
|
+
|
|
34
|
+
|
|
22
35
|
__all__ = [
|
|
23
36
|
"DepthAnythingV1Config",
|
|
24
37
|
"DepthAnythingV1Model",
|
|
@@ -8,17 +8,30 @@ from .configuration_depth_anything_v2 import (
|
|
|
8
8
|
DepthAnythingV2Config,
|
|
9
9
|
_V2_VARIANT_MAP,
|
|
10
10
|
)
|
|
11
|
-
from .modeling_depth_anything_v2 import DepthAnythingV2Model
|
|
12
11
|
from ...registry import MODEL_REGISTRY
|
|
13
12
|
|
|
13
|
+
|
|
14
|
+
def _load_model_cls():
|
|
15
|
+
from .modeling_depth_anything_v2 import DepthAnythingV2Model
|
|
16
|
+
return DepthAnythingV2Model
|
|
17
|
+
|
|
18
|
+
|
|
14
19
|
# Self-register with the global registry
|
|
15
20
|
MODEL_REGISTRY.register(
|
|
16
21
|
model_type="depth-anything-v2",
|
|
17
22
|
config_cls=DepthAnythingV2Config,
|
|
18
|
-
model_cls=
|
|
23
|
+
model_cls=_load_model_cls,
|
|
19
24
|
variant_ids=list(_V2_VARIANT_MAP.keys()),
|
|
20
25
|
)
|
|
21
26
|
|
|
27
|
+
|
|
28
|
+
def __getattr__(name):
|
|
29
|
+
if name == "DepthAnythingV2Model":
|
|
30
|
+
from .modeling_depth_anything_v2 import DepthAnythingV2Model
|
|
31
|
+
return DepthAnythingV2Model
|
|
32
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
33
|
+
|
|
34
|
+
|
|
22
35
|
__all__ = [
|
|
23
36
|
"DepthAnythingV2Config",
|
|
24
37
|
"DepthAnythingV2Model",
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"""Depth Anything v3 model package — self-registers with MODEL_REGISTRY."""
|
|
2
|
+
|
|
3
|
+
from .configuration_depth_anything_v3 import (
|
|
4
|
+
DepthAnythingV3Config,
|
|
5
|
+
_V3_VARIANT_MAP,
|
|
6
|
+
_V3_NESTED_VARIANT_IDS,
|
|
7
|
+
)
|
|
8
|
+
from ...registry import MODEL_REGISTRY
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def _load_model_cls():
|
|
12
|
+
from .modeling_depth_anything_v3 import DepthAnythingV3Model
|
|
13
|
+
return DepthAnythingV3Model
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _load_nested_model_cls():
|
|
17
|
+
from .modeling_depth_anything_v3 import DepthAnythingV3NestedModel
|
|
18
|
+
return DepthAnythingV3NestedModel
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
MODEL_REGISTRY.register(
|
|
22
|
+
model_type="depth-anything-v3",
|
|
23
|
+
config_cls=DepthAnythingV3Config,
|
|
24
|
+
model_cls=_load_model_cls,
|
|
25
|
+
variant_ids=list(_V3_VARIANT_MAP.keys()),
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
MODEL_REGISTRY.register(
|
|
29
|
+
model_type="depth-anything-v3-nested",
|
|
30
|
+
config_cls=DepthAnythingV3Config,
|
|
31
|
+
model_cls=_load_nested_model_cls,
|
|
32
|
+
variant_ids=_V3_NESTED_VARIANT_IDS,
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def __getattr__(name):
|
|
37
|
+
if name == "DepthAnythingV3Model":
|
|
38
|
+
from .modeling_depth_anything_v3 import DepthAnythingV3Model
|
|
39
|
+
return DepthAnythingV3Model
|
|
40
|
+
if name == "DepthAnythingV3NestedModel":
|
|
41
|
+
from .modeling_depth_anything_v3 import DepthAnythingV3NestedModel
|
|
42
|
+
return DepthAnythingV3NestedModel
|
|
43
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
__all__ = [
|
|
47
|
+
"DepthAnythingV3Config",
|
|
48
|
+
"DepthAnythingV3Model",
|
|
49
|
+
"DepthAnythingV3NestedModel",
|
|
50
|
+
]
|
{depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/models/depth_pro/__init__.py
RENAMED
|
@@ -1,14 +1,27 @@
|
|
|
1
1
|
"""Apple DepthPro model package — self-registers with MODEL_REGISTRY."""
|
|
2
2
|
|
|
3
3
|
from .configuration_depth_pro import DepthProConfig, _DEPTHPRO_VARIANT_MAP
|
|
4
|
-
from .modeling_depth_pro import DepthProModel
|
|
5
4
|
from ...registry import MODEL_REGISTRY
|
|
6
5
|
|
|
6
|
+
|
|
7
|
+
def _load_model_cls():
|
|
8
|
+
from .modeling_depth_pro import DepthProModel
|
|
9
|
+
return DepthProModel
|
|
10
|
+
|
|
11
|
+
|
|
7
12
|
MODEL_REGISTRY.register(
|
|
8
13
|
model_type="depth-pro",
|
|
9
14
|
config_cls=DepthProConfig,
|
|
10
|
-
model_cls=
|
|
15
|
+
model_cls=_load_model_cls,
|
|
11
16
|
variant_ids=list(_DEPTHPRO_VARIANT_MAP.keys()),
|
|
12
17
|
)
|
|
13
18
|
|
|
19
|
+
|
|
20
|
+
def __getattr__(name):
|
|
21
|
+
if name == "DepthProModel":
|
|
22
|
+
from .modeling_depth_pro import DepthProModel
|
|
23
|
+
return DepthProModel
|
|
24
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
25
|
+
|
|
26
|
+
|
|
14
27
|
__all__ = ["DepthProConfig", "DepthProModel"]
|
|
@@ -1,14 +1,27 @@
|
|
|
1
1
|
"""Marigold-DC model package — self-registers with MODEL_REGISTRY."""
|
|
2
2
|
|
|
3
3
|
from .configuration_marigold_dc import MarigoldDCConfig, _MARIGOLD_DC_VARIANT_MAP
|
|
4
|
-
from .modeling_marigold_dc import MarigoldDCModel
|
|
5
4
|
from ...registry import MODEL_REGISTRY
|
|
6
5
|
|
|
6
|
+
|
|
7
|
+
def _load_model_cls():
|
|
8
|
+
from .modeling_marigold_dc import MarigoldDCModel
|
|
9
|
+
return MarigoldDCModel
|
|
10
|
+
|
|
11
|
+
|
|
7
12
|
MODEL_REGISTRY.register(
|
|
8
13
|
model_type="marigold-dc",
|
|
9
14
|
config_cls=MarigoldDCConfig,
|
|
10
|
-
model_cls=
|
|
15
|
+
model_cls=_load_model_cls,
|
|
11
16
|
variant_ids=list(_MARIGOLD_DC_VARIANT_MAP.keys()),
|
|
12
17
|
)
|
|
13
18
|
|
|
19
|
+
|
|
20
|
+
def __getattr__(name):
|
|
21
|
+
if name == "MarigoldDCModel":
|
|
22
|
+
from .modeling_marigold_dc import MarigoldDCModel
|
|
23
|
+
return MarigoldDCModel
|
|
24
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
25
|
+
|
|
26
|
+
|
|
14
27
|
__all__ = ["MarigoldDCConfig", "MarigoldDCModel"]
|
{depth_estimation-0.0.6 → depth_estimation-0.0.7}/src/depth_estimation/models/midas/__init__.py
RENAMED
|
@@ -1,14 +1,27 @@
|
|
|
1
1
|
"""MiDaS model package — self-registers with MODEL_REGISTRY."""
|
|
2
2
|
|
|
3
3
|
from .configuration_midas import MiDaSConfig, _MIDAS_VARIANT_MAP
|
|
4
|
-
from .modeling_midas import MiDaSModel
|
|
5
4
|
from ...registry import MODEL_REGISTRY
|
|
6
5
|
|
|
6
|
+
|
|
7
|
+
def _load_model_cls():
|
|
8
|
+
from .modeling_midas import MiDaSModel
|
|
9
|
+
return MiDaSModel
|
|
10
|
+
|
|
11
|
+
|
|
7
12
|
MODEL_REGISTRY.register(
|
|
8
13
|
model_type="midas",
|
|
9
14
|
config_cls=MiDaSConfig,
|
|
10
|
-
model_cls=
|
|
15
|
+
model_cls=_load_model_cls,
|
|
11
16
|
variant_ids=list(_MIDAS_VARIANT_MAP.keys()),
|
|
12
17
|
)
|
|
13
18
|
|
|
19
|
+
|
|
20
|
+
def __getattr__(name):
|
|
21
|
+
if name == "MiDaSModel":
|
|
22
|
+
from .modeling_midas import MiDaSModel
|
|
23
|
+
return MiDaSModel
|
|
24
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
25
|
+
|
|
26
|
+
|
|
14
27
|
__all__ = ["MiDaSConfig", "MiDaSModel"]
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"""MoGe model package — self-registers with MODEL_REGISTRY."""
|
|
2
|
+
|
|
3
|
+
from .configuration_moge import MoGeConfig, _MOGE_VARIANT_MAP
|
|
4
|
+
from ...registry import MODEL_REGISTRY
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def _load_model_cls():
|
|
8
|
+
from .modeling_moge import MoGeModel
|
|
9
|
+
return MoGeModel
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
MODEL_REGISTRY.register(
|
|
13
|
+
model_type="moge",
|
|
14
|
+
config_cls=MoGeConfig,
|
|
15
|
+
model_cls=_load_model_cls,
|
|
16
|
+
variant_ids=list(_MOGE_VARIANT_MAP.keys()),
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def __getattr__(name):
|
|
21
|
+
if name == "MoGeModel":
|
|
22
|
+
from .modeling_moge import MoGeModel
|
|
23
|
+
return MoGeModel
|
|
24
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
__all__ = ["MoGeConfig", "MoGeModel"]
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"""
|
|
2
|
+
MoGe configuration.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from ...configuration_utils import BaseDepthConfig
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
_MOGE_VARIANT_MAP = {
|
|
9
|
+
"moge-v1": {
|
|
10
|
+
"backbone": "vitl",
|
|
11
|
+
"version": "v1",
|
|
12
|
+
"hub_repo_id": "Ruicheng/moge-vitl",
|
|
13
|
+
"is_metric": False,
|
|
14
|
+
"embed_dim": 1024,
|
|
15
|
+
"num_heads": 16,
|
|
16
|
+
"num_layers": 24,
|
|
17
|
+
},
|
|
18
|
+
"moge-v2-vitl": {
|
|
19
|
+
"backbone": "vitl",
|
|
20
|
+
"version": "v2",
|
|
21
|
+
"hub_repo_id": "Ruicheng/moge-2-vitl",
|
|
22
|
+
"is_metric": True,
|
|
23
|
+
"embed_dim": 1024,
|
|
24
|
+
"num_heads": 16,
|
|
25
|
+
"num_layers": 24,
|
|
26
|
+
},
|
|
27
|
+
"moge-v2-vitl-normal": {
|
|
28
|
+
"backbone": "vitl",
|
|
29
|
+
"version": "v2",
|
|
30
|
+
"hub_repo_id": "Ruicheng/moge-2-vitl-normal",
|
|
31
|
+
"is_metric": True,
|
|
32
|
+
"embed_dim": 1024,
|
|
33
|
+
"num_heads": 16,
|
|
34
|
+
"num_layers": 24,
|
|
35
|
+
},
|
|
36
|
+
"moge-v2-vitb-normal": {
|
|
37
|
+
"backbone": "vitb",
|
|
38
|
+
"version": "v2",
|
|
39
|
+
"hub_repo_id": "Ruicheng/moge-2-vitb-normal",
|
|
40
|
+
"is_metric": True,
|
|
41
|
+
"embed_dim": 768,
|
|
42
|
+
"num_heads": 12,
|
|
43
|
+
"num_layers": 12,
|
|
44
|
+
},
|
|
45
|
+
"moge-v2-vits-normal": {
|
|
46
|
+
"backbone": "vits",
|
|
47
|
+
"version": "v2",
|
|
48
|
+
"hub_repo_id": "Ruicheng/moge-2-vits-normal",
|
|
49
|
+
"is_metric": True,
|
|
50
|
+
"embed_dim": 384,
|
|
51
|
+
"num_heads": 6,
|
|
52
|
+
"num_layers": 12,
|
|
53
|
+
},
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class MoGeConfig(BaseDepthConfig):
|
|
58
|
+
"""Configuration for MoGe (Monocular Geometry Estimation).
|
|
59
|
+
|
|
60
|
+
Supports both MoGe-1 (relative/affine depth) and MoGe-2 (metric depth,
|
|
61
|
+
optional normal maps). Weights are loaded from HuggingFace Hub via the
|
|
62
|
+
``moge`` package.
|
|
63
|
+
"""
|
|
64
|
+
|
|
65
|
+
model_type = "moge"
|
|
66
|
+
|
|
67
|
+
def __init__(
|
|
68
|
+
self,
|
|
69
|
+
backbone: str = "vitl",
|
|
70
|
+
version: str = "v2",
|
|
71
|
+
hub_repo_id: str = "Ruicheng/moge-2-vitl",
|
|
72
|
+
is_metric: bool = True,
|
|
73
|
+
input_size: int = 518,
|
|
74
|
+
patch_size: int = 14,
|
|
75
|
+
**kwargs,
|
|
76
|
+
):
|
|
77
|
+
super().__init__(
|
|
78
|
+
backbone=backbone,
|
|
79
|
+
input_size=input_size,
|
|
80
|
+
patch_size=patch_size,
|
|
81
|
+
is_metric=is_metric,
|
|
82
|
+
# MoGe applies its own ImageNet normalization internally,
|
|
83
|
+
# so we pass raw [0, 1] values from the DepthProcessor.
|
|
84
|
+
mean=[0.0, 0.0, 0.0],
|
|
85
|
+
std=[1.0, 1.0, 1.0],
|
|
86
|
+
**kwargs,
|
|
87
|
+
)
|
|
88
|
+
self.version = version
|
|
89
|
+
self.hub_repo_id = hub_repo_id
|
|
90
|
+
|
|
91
|
+
@classmethod
|
|
92
|
+
def from_variant(cls, variant_id: str) -> "MoGeConfig":
|
|
93
|
+
if variant_id not in _MOGE_VARIANT_MAP:
|
|
94
|
+
raise ValueError(
|
|
95
|
+
f"Unknown MoGe variant '{variant_id}'. "
|
|
96
|
+
f"Available: {list(_MOGE_VARIANT_MAP.keys())}"
|
|
97
|
+
)
|
|
98
|
+
return cls(**_MOGE_VARIANT_MAP[variant_id])
|