Skip to content

Commit 0f9fff9

Browse files
philkuzBernardZach
authored andcommitted
fix(DPT,Depth-Anything) Address expected_slice errors inside inference tests (huggingface#34518)
* fix(DPT,Depth-Anything) Address expected_slice errors inside inference tests Signed-off-by: Phillip Kuznetsov <[email protected]> * [run_slow] dpt, depth_anything --------- Signed-off-by: Phillip Kuznetsov <[email protected]>
1 parent 1e7f0bd commit 0f9fff9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tests/models/depth_anything/test_modeling_depth_anything.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def test_inference(self):
263263
self.assertEqual(predicted_depth.shape, expected_shape)
264264

265265
expected_slice = torch.tensor(
266-
[[8.8204, 8.6468, 8.6195], [8.3313, 8.6027, 8.7526], [8.6526, 8.6866, 8.7453]],
266+
[[8.8223, 8.6483, 8.6216], [8.3332, 8.6047, 8.7545], [8.6547, 8.6885, 8.7472]],
267267
).to(torch_device)
268268

269269
self.assertTrue(torch.allclose(predicted_depth[0, :3, :3], expected_slice, atol=1e-6))
@@ -286,7 +286,7 @@ def test_inference(self):
286286
self.assertEqual(predicted_depth.shape, expected_shape)
287287

288288
expected_slice = torch.tensor(
289-
[[1.3349, 1.2946, 1.2801], [1.2793, 1.2337, 1.2899], [1.2629, 1.2218, 1.2476]],
289+
[[1.3349, 1.2947, 1.2802], [1.2794, 1.2338, 1.2901], [1.2630, 1.2219, 1.2478]],
290290
).to(torch_device)
291291

292292
self.assertTrue(torch.allclose(predicted_depth[0, :3, :3], expected_slice, atol=1e-4))

tests/models/dpt/test_modeling_dpt_auto_backbone.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def test_inference_depth_estimation_dinov2(self):
274274
self.assertEqual(predicted_depth.shape, expected_shape)
275275

276276
expected_slice = torch.tensor(
277-
[[6.0433, 7.1636, 7.4268], [6.9047, 7.2471, 7.2355], [7.9261, 8.0631, 8.0244]]
277+
[[6.0336, 7.1502, 7.4130], [6.8977, 7.2383, 7.2268], [7.9180, 8.0525, 8.0134]]
278278
).to(torch_device)
279279

280280
self.assertTrue(torch.allclose(outputs.predicted_depth[0, :3, :3], expected_slice, atol=1e-4))

0 commit comments

Comments
 (0)