@pytest.mark.skipif((not _IMAGE_TESTING), reason="image libraries aren't installed.")
@pytest.mark.parametrize('num_classes', [8, 256])
@pytest.mark.parametrize('img_shape', [(1, 3, 224, 192), (2, 3, 128, 256)])
def test_forward(num_classes, img_shape):
    model = SemanticSegmentation(num_classes=num_classes, backbone='resnet50', head='fpn')
    (B, C, H, W) = img_shape
    img = torch.rand(B, C, H, W)
    out = model(img)
    assert (out.shape == (B, num_classes, H, W))
@pytest.mark.skipif((not _IMAGE_TESTING), reason="image libraries aren't installed.")
@pytest.mark.parametrize('num_classes', [8, 256])
@pytest.mark.parametrize('img_shape', [(1, 3, 224, 192), (2, 3, 128, 256)])
def test_forward(num_classes, img_shape):
    model = SemanticSegmentation(num_classes=num_classes, backbone='resnet50', head='fpn')
    (B, C, H, W) = img_shape
    img = torch.rand(B, C, H, W)
    out = model(img)
    assert (out.shape == (B, num_classes, H, W))