From 3bd8178a54aea2b768d3767c611fffc9ed970520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=92=E9=BE=8D=E8=81=96=E8=80=85=40bdsqlsz?= <865105819@qq.com> Date: Sat, 15 Jun 2024 23:59:22 +0800 Subject: [PATCH 1/3] Update depth_anything.py --- annotator/depth_anything.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/annotator/depth_anything.py b/annotator/depth_anything.py index bbe480c5e..b01d58727 100644 --- a/annotator/depth_anything.py +++ b/annotator/depth_anything.py @@ -47,7 +47,7 @@ def __init__(self, device: torch.device): ) remote_url = os.environ.get( "CONTROLNET_DEPTH_ANYTHING_MODEL_URL", - "https://huggingface.co/spaces/LiheYoung/Depth-Anything/resolve/main/checkpoints/depth_anything_vitl14.pth", + "https://huggingface.co/depth-anything/Depth-Anything-V2-Large/resolve/main/depth_anything_v2_vitl.pth", ) model_path = load_model( "depth_anything_vitl14.pth", remote_url=remote_url, model_dir=self.model_dir From 85512d4c7dc73174f9aa065329e9e42fd13bc145 Mon Sep 17 00:00:00 2001 From: sdbds <865105819@qq.com> Date: Sun, 16 Jun 2024 00:06:23 +0800 Subject: [PATCH 2/3] change model name --- annotator/depth_anything.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/annotator/depth_anything.py b/annotator/depth_anything.py index b01d58727..e66da1d85 100644 --- a/annotator/depth_anything.py +++ b/annotator/depth_anything.py @@ -50,7 +50,7 @@ def __init__(self, device: torch.device): "https://huggingface.co/depth-anything/Depth-Anything-V2-Large/resolve/main/depth_anything_v2_vitl.pth", ) model_path = load_model( - "depth_anything_vitl14.pth", remote_url=remote_url, model_dir=self.model_dir + "depth_anything_v2_vitl.pth", remote_url=remote_url, model_dir=self.model_dir ) self.model.load_state_dict(torch.load(model_path)) From 4ff2ab7e63ece42cc5c761dc029f3d27d3c79c98 Mon Sep 17 00:00:00 2001 From: sdbds <865105819@qq.com> Date: Sun, 16 Jun 2024 00:40:54 +0800 Subject: [PATCH 3/3] Update depth_anything.py --- annotator/depth_anything.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/annotator/depth_anything.py b/annotator/depth_anything.py index e66da1d85..bb39af403 100644 --- a/annotator/depth_anything.py +++ b/annotator/depth_anything.py @@ -73,7 +73,7 @@ def predict_depth(model, image): if colored: return cv2.applyColorMap(depth, cv2.COLORMAP_INFERNO)[:, :, ::-1] else: - return depth + return np.repeat(depth[..., np.newaxis], 3, axis=-1) def unload_model(self): self.model.to("cpu")