diff --git a/depth_anything_v2/dinov2.py b/depth_anything_v2/dinov2.py index 83d2508..494f53f 100644 --- a/depth_anything_v2/dinov2.py +++ b/depth_anything_v2/dinov2.py @@ -200,7 +200,7 @@ def interpolate_pos_encoding(self, x, w, h): patch_pos_embed.reshape(1, int(sqrt_N), int(sqrt_N), dim).permute(0, 3, 1, 2), scale_factor=(sx, sy), # (int(w0), int(h0)), # to solve the upsampling shape issue - mode="bicubic", + mode="bicubic" if x.device.type != "mps" else "bilinear", antialias=self.interpolate_antialias )