File size: 359 Bytes
41ff959
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import torch

from src.model.encoder.depth.infinidepth.sampling_utils import (
    compute_image_gradient_strength,
)


def test_compute_image_gradient_strength_returns_finite_map() -> None:
    image = torch.rand(3, 8, 12)

    strength = compute_image_gradient_strength(image)

    assert strength.shape == (8, 12)
    assert torch.isfinite(strength).all()