Skip to content
Draft
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
9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "depth-anything-3"
version = "0.0.0"
description = "Depth Anything 3"
readme = "README.md"
requires-python = ">=3.9, <=3.13"
requires-python = ">=3.10, <=3.13"
license = { text = "Apache-2.0" }
authors = [{ name = "Your Name" }]

Expand All @@ -21,7 +21,7 @@ dependencies = [
"imageio",
"numpy<2",
"opencv-python",
"xformers",
# "xformers", # Commented out to support macOS/MPS/CPU (xformers is CUDA-only)
"open3d",
"fastapi",
"uvicorn",
Expand All @@ -43,8 +43,9 @@ dependencies = [

[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]"]
# Commented out to support macOS/MPS/CPU (gsplat requires CUDA compilation)
# gs = ["gsplat @ git+https://github.com/nerfstudio-project/gsplat.git@0b4dddf04cb687367602c01196913cde6a743d70"]
# all = ["depth-anything-3[app,gs]"]


[project.scripts]
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ huggingface_hub
imageio
numpy<2
opencv-python
xformers
# xformers # Commented out to support macOS/MPS/CPU (CUDA-only)
open3d
fastapi
uvicorn
Expand Down
13 changes: 7 additions & 6 deletions src/depth_anything_3/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
from __future__ import annotations

import os
os.environ["KMP_DUPLICATE_LIB_OK"] = "TRUE" # Prevent OpenMP double initialization crash on macOS
os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "expandable_segments:True"

import typer

from depth_anything_3.services import start_server
Expand All @@ -40,8 +43,6 @@
DEFAULT_MODEL,
)

os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "expandable_segments:True"

app = typer.Typer(help="Depth Anything 3 - Video depth estimation CLI", add_completion=False)


Expand Down Expand Up @@ -380,7 +381,7 @@ def image(
process_res_method=process_res_method,
export_feat_layers=export_feat_layers,
use_ray_pose=use_ray_pose,
reference_view_strategy=reference_view_strategy,
ref_view_strategy=ref_view_strategy, # Changed from reference_view_strategy to fix NameError
conf_thresh_percentile=conf_thresh_percentile,
num_max_points=num_max_points,
show_cameras=show_cameras,
Expand Down Expand Up @@ -459,7 +460,7 @@ def images(
process_res_method=process_res_method,
export_feat_layers=export_feat_layers,
use_ray_pose=use_ray_pose,
reference_view_strategy=reference_view_strategy,
ref_view_strategy=ref_view_strategy, # Changed from reference_view_strategy to fix NameError
conf_thresh_percentile=conf_thresh_percentile,
num_max_points=num_max_points,
show_cameras=show_cameras,
Expand Down Expand Up @@ -546,7 +547,7 @@ def colmap(
intrinsics=intrinsics,
align_to_input_ext_scale=align_to_input_ext_scale,
use_ray_pose=use_ray_pose,
reference_view_strategy=reference_view_strategy,
ref_view_strategy=ref_view_strategy, # Changed from reference_view_strategy to fix NameError
conf_thresh_percentile=conf_thresh_percentile,
num_max_points=num_max_points,
show_cameras=show_cameras,
Expand Down Expand Up @@ -623,7 +624,7 @@ def video(
process_res_method=process_res_method,
export_feat_layers=export_feat_layers,
use_ray_pose=use_ray_pose,
reference_view_strategy=reference_view_strategy,
ref_view_strategy=ref_view_strategy, # Changed from reference_view_strategy to fix NameError
conf_thresh_percentile=conf_thresh_percentile,
num_max_points=num_max_points,
show_cameras=show_cameras,
Expand Down