Skip to content

anomaly

draem()

Yield a draem model.

Source code in quadra/utils/tests/fixtures/models/anomaly.py
66
67
68
69
@pytest.fixture
def draem():
    """Yield a draem model."""
    yield DraemModel()

padim_resnet18()

Yield a padim model with resnet18 encoder.

Source code in quadra/utils/tests/fixtures/models/anomaly.py
 8
 9
10
11
12
13
14
15
16
17
18
@pytest.fixture
def padim_resnet18():
    """Yield a padim model with resnet18 encoder."""
    yield PadimModel(
        input_size=[224, 224],  # TODO: This is hardcoded may be not a good idea
        backbone="resnet18",
        layers=["layer1", "layer2", "layer3"],
        pretrained_weights=None,
        tied_covariance=False,
        pre_trained=False,
    )

patchcore_resnet18()

Yield a patchcore model with resnet18 encoder.

Source code in quadra/utils/tests/fixtures/models/anomaly.py
53
54
55
56
57
58
59
60
61
62
63
@pytest.fixture
def patchcore_resnet18():
    """Yield a patchcore model with resnet18 encoder."""
    model = PatchcoreModel(
        input_size=[224, 224],  # TODO: This is hardcoded may be not a good idea
        backbone="resnet18",
        layers=["layer2", "layer3"],
        pre_trained=False,
    )

    yield _initialize_patchcore_model(model)