Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ dependencies = [
"einops",
"huggingface_hub",
"imageio",
"numpy<2",
"opencv-python",
"xformers",
"numpy>=2.0,<3",
"opencv-python>=4.8.0",
"open3d",
"fastapi",
"uvicorn",
Expand All @@ -38,13 +37,14 @@ dependencies = [
"uvicorn",
"moviepy==1.0.3",
"typer>=0.9.0",
"pycolmap",
]

[project.optional-dependencies]
app = ["gradio>=5", "pillow>=9.0"] # requires that python3>=3.10
gs = ["gsplat @ git+https://github.com/nerfstudio-project/gsplat.git@0b4dddf04cb687367602c01196913cde6a743d70"]
all = ["depth-anything-3[app,gs]"]
colmap = ["pycolmap"]
xformers = ["xformers"]
all = ["depth-anything-3[app,gs,colmap,xformers]"]


[project.scripts]
Expand Down
7 changes: 6 additions & 1 deletion src/depth_anything_3/utils/export/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from depth_anything_3.specs import Prediction
from depth_anything_3.utils.export.gs import export_to_gs_ply, export_to_gs_video

from .colmap import export_to_colmap
from .depth_vis import export_to_depth_vis
from .feat_vis import export_to_feat_vis
from .glb import export_to_glb
Expand Down Expand Up @@ -49,6 +48,12 @@ def export(
elif export_format == "gs_video":
export_to_gs_video(prediction, export_dir, **kwargs.get(export_format, {}))
elif export_format == "colmap":
try:
from .colmap import export_to_colmap
except ImportError as e:
raise ImportError(
"pycolmap is not installed. Please install it using 'pip install pycolmap' to use the COLMAP export feature."
) from e
export_to_colmap(prediction, export_dir, **kwargs.get(export_format, {}))
else:
raise ValueError(f"Unsupported export format: {export_format}")
Expand Down
2 changes: 1 addition & 1 deletion src/depth_anything_3/utils/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def visualize_depth(
img_colored_np = cm(depth[None], bytes=False)[:, :, :, 0:3] # value from 0 to 1
if ret_type == np.uint8:
img_colored_np = (img_colored_np[0] * 255.0).astype(np.uint8)
elif ret_type == np.float32 or ret_type == np.float64:
elif np.issubdtype(ret_type, np.floating):
img_colored_np = img_colored_np[0]
else:
raise ValueError(f"Invalid return type: {ret_type}")
Expand Down