SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2303.14535 · 2023

EfficientAD: Accurate Visual Anomaly Detection at Millisecond-Level Latencies

arXiv · PDF · Open in the Atlas

Code that ran

29 of 35 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 27 have no contract verdict; 1 failure of our instrument; 6 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2303.14535.json · badge: /api/ran/2303.14535.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
Eacient/EfficientAD community (classifier label)
classifier basis not recorded on the link
9 ran · 0 no recorded run
cinout/EfficientAD community (classifier label)
classifier basis not recorded on the link
7 ran · 1 no recorded run
Zaza-97/EfficientAD community (classifier label)
classifier basis not recorded on the link
5 ran · 1 no recorded run
henry1985/EfficientAD community (classifier label)
classifier basis not recorded on the link
5 ran · 0 no recorded run
dellysursh/EfficientAD community (classifier label)
classifier basis not recorded on the link
1 ran · 1 no recorded run
LeapMind/PUAD community (classifier label)
classifier basis not recorded on the link
1 ran · 0 no recorded run
danielsoy/EfficientAD-1 community (classifier label)
classifier basis not recorded on the link
1 ran · 0 no recorded run
ntkhoa95/EfficientAD community (classifier label)
classifier basis not recorded on the link
0 ran · 3 no recorded run
FunctionStatusWhere it lives
compute_classification_roc Ran
ran on a synthesized input
henry1985/EfficientAD/mvtec_ad_evaluation/roc_curve_util.py
code served (permissive licence) · get_code("1171ab65a42cb909")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create small anomaly maps (2D numpy arrays)
anomaly_map_1 = np.array([[0.1, 0.2], [0.3, 0.4]])
anomaly_map_2 = np.array([[0.15, 0.25], [0.35, 0.45]])
anomaly_map_3 = np.array([[0.05, 0.15], [0.25, 0.35]])
anomaly_map_4 = np.array([[0.5, 0.6], [0.7, 0.8]])

anomaly_maps = [anomaly_map_1, anomaly_map_2, anomaly_map_3, anomaly_map_4]

# Define a simple scoring function that takes max value from anomaly map
def scoring_function(anomaly_map):
    """Returns the maximum anomaly score from the map."""
    return np.max(anomaly_map)

# Ground truth labels: 0 for normal, non-zero for anomalous
ground_truth_labels = [0, 0, 1, 1]

ARGS = {
    "anomaly_maps": anomaly_maps,
    "scoring_function": scoring_function,
    "ground_truth_labels": ground_truth_labels,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
compute_pro Ran
ran on a synthesized input
henry1985/EfficientAD/mvtec_ad_evaluation/pro_curve_util.py
code served (permissive licence) · get_code("65ccd9c3a0376427")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create small anomaly maps (2D numpy arrays with real-valued anomaly scores)
# Using distinct sizes: 4x3 for height x width
anomaly_map_1 = np.random.rand(4, 3).astype(np.float32)
anomaly_map_2 = np.random.rand(4, 3).astype(np.float32)
anomaly_maps = [anomaly_map_1, anomaly_map_2]

# Create corresponding ground truth maps (binary: 0 or 1)
ground_truth_map_1 = np.array([
    [0, 1, 0],
    [1, 1, 0],
    [0, 0, 1],
    [0, 1, 1]
], dtype=np.uint8)

ground_truth_map_2 = np.array([
    [1, 0, 1],
    [0, 0, 0],
    [1, 1, 0],
    [0, 0, 1]
], dtype=np.uint8)

ground_truth_maps = [ground_truth_map_1, ground_truth_map_2]

ARGS = {
    "anomaly_maps": anomaly_maps,
    "ground_truth_maps": ground_truth_maps,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
feature_normalization Ran
ran on a synthesized input
Eacient/EfficientAD/pretraining.py
code served (permissive licence) · get_code("ded046c9ee356f89")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 5, dtype family float; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

class MockExtractor(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv = nn.Conv2d(3, 4, kernel_size=1)
    
    def embed(self, x):
        # Returns tensor of shape (batch, channels, height, width)
        return self.conv(x)

# Create a small extractor
extractor = MockExtractor()

# Create a small train_loader with 2 batches of (image, label)
# Each image: (batch_size=2, channels=3, height=8, width=8)
batch1 = (torch.randn(2, 3, 8, 8), torch.tensor([0, 1]))
batch2 = (torch.randn(2, 3, 8, 8), torch.tensor([1, 0]))
train_loader = [batch1, batch2]

ARGS = {
    'extractor': extractor,
    'train_loader': train_loader,
    'steps': 10000
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 5, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
feature_normalization Ran
ran on a synthesized input
cinout/EfficientAD/pretraining.py
code served (permissive licence) · get_code("b0ac6b6a8e05c91a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 5, dtype family float; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

class SimpleExtractor(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv = nn.Conv2d(3, 4, kernel_size=3, padding=1)
    
    def embed(self, x):
        # Returns shape (batch, channels, height, width)
        return self.conv(x)

# Create a small extractor
extractor = SimpleExtractor()

# Create a simple train loader with 2 batches of (image, label)
# Each image is (batch_size=2, channels=3, height=5, width=5)
train_loader = [
    (torch.randn(2, 3, 5, 5), torch.tensor([0, 1])),
    (torch.randn(2, 3, 5, 5), torch.tensor([1, 0])),
]

# Create a simple args object (can be a dict or a class)
args = {}

ARGS = {
    'args': args,
    'extractor': extractor,
    'train_loader': train_loader,
    'steps': 10000
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 5, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
generate_toy_dataset Ran
ran on a synthesized input
henry1985/EfficientAD/mvtec_ad_evaluation/generic_util.py
code served (permissive licence) · get_code("92626665be140960")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 4, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

ARGS = {
    "num_images": 3,
    "image_width": 64,
    "image_height": 48,
    "gt_size": 16,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 4, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_autoencoder Ran
ran on a synthesized input
Eacient/EfficientAD/common.py
code served (permissive licence) · get_code("a2984f3ccda7db18")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Sequential. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from torch import nn

torch.manual_seed(0)

ARGS = {
    "out_channels": 384
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_autoencoder Ran
ran on a synthesized input
Zaza-97/EfficientAD/common.py
code served (permissive licence) · get_code("a3bf841cdd61584a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Sequential. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# The function get_autoencoder takes 5 parameters:
# im_height, im_width, out_height, out_width, out_channels
# All are integers used to define the autoencoder architecture

ARGS = {
    "im_height": 256,
    "im_width": 256,
    "out_height": 128,
    "out_width": 128,
    "out_channels": 384,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_autoencoder Ran
ran on a synthesized input
dellysursh/EfficientAD/common.py
code served (permissive licence) · get_code("cf1eea789ca4d810")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Sequential. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from torch import nn

torch.manual_seed(0)

ARGS = {
    "out_channels": 384
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_autoencoder_small Ran
ran on a synthesized input
Zaza-97/EfficientAD/common.py
code served (permissive licence) · get_code("45760bcd8da72e6f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Sequential. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from torch import nn

torch.manual_seed(0)

# The function takes 5 parameters: im_height, im_width, out_height, out_width, out_channels
# These are all integers used to define the architecture of an autoencoder
# We need to provide reasonable values that will work with the network structure

ARGS = {
    "im_height": 256,
    "im_width": 256,
    "out_height": 64,
    "out_width": 64,
    "out_channels": 384
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_pdn Ran
ran on a synthesized input
Eacient/EfficientAD/benchmark.py
code served (permissive licence) · get_code("3c3ed7dd6e348895")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Sequential. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# The function get_pdn takes one optional parameter: out (default 384)
# It constructs and returns an nn.Sequential model
# No other arguments are needed based on the function signature

ARGS = {
    "out": 384
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_pdn_medium Ran
ran on a synthesized input
Eacient/EfficientAD/common.py
code served (permissive licence) · get_code("f55436fae7d32859")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Sequential. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    "out_channels": 384,
    "padding": False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_pdn_small Ran
ran on a synthesized input
Eacient/EfficientAD/common.py
code served (permissive licence) · get_code("cb104f86feb3ef61")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Sequential. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'out_channels': 384,
    'padding': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_pdn_small_max Ran
ran on a synthesized input
Zaza-97/EfficientAD/common.py
code served (permissive licence) · get_code("5820f47382ce8e2e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Sequential. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from torch import nn

torch.manual_seed(0)

ARGS = {
    "out_channels": 384,
    "padding": False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
lid_mle Ran
ran on a synthesized input
cinout/EfficientAD/efficientad.py
code served (permissive licence) · get_code("f85e08a3d3105e5c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 1, dtype family float, shape (2,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create small tensors for data and reference
# data: shape (batch_size, flattened_features)
# reference: shape (batch_size, flattened_features)
# Using distinct dimensions: data has 2 samples, reference has 3 samples
data = torch.randn(2, 4)
reference = torch.randn(3, 4)

ARGS = {
    'data': data,
    'reference': reference,
    'k': 2,
    'compute_mode': 'use_mm_for_euclid_dist_if_necessary'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 1, dtype family float, shape (2,) — shape (2,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
make_layer Ran
ran on a synthesized input
cinout/EfficientAD/common.py
code served (permissive licence) · get_code("144d898a5033505c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Sequential. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal block class that satisfies the requirements
class MinimalBlock(nn.Module):
    expansion = 2  # Define expansion attribute used in make_layer
    
    def __init__(self, inplanes, planes, stride=1, downsample=None, norm_layer=None):
        super().__init__()
        if norm_layer is None:
            norm_layer = nn.BatchNorm2d
        self.conv1 = nn.Conv2d(inplanes, planes, kernel_size=3, stride=stride, padding=1, bias=False)
        self.bn1 = norm_layer(planes)
        self.conv2 = nn.Conv2d(planes, planes * self.expansion, kernel_size=3, padding=1, bias=False)
        self.bn2 = norm_layer(planes * self.expansion)
        self.downsample = downsample
        self.stride = stride
    
    def forward(self, x):
        identity = x
        out = self.conv1(x)
        out = self.bn1(out)
        out = self.conv2(out)
        out = self.bn2(out)
        if self.downsample is not None:
            identity = self.downsample(x)
        out = out + identity
        return out

# Set up arguments for make_layer
ARGS = {
    "block": MinimalBlock,
    "inplanes": 4,
    "planes": 3,
    "blocks": 2,
    "stride": 1,
    "norm_layer": nn.BatchNorm2d,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
normalizeData Ran
ran on a synthesized input
cinout/EfficientAD/efficientad.py
code served (permissive licence) · get_code("f1a2a9757a1d351a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Create small test tensors
data = torch.randn(2, 4)
minval = torch.tensor(0.0)
maxval = torch.tensor(1.0)

ARGS = {
    "data": data,
    "minval": minval,
    "maxval": maxval,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
predict Ran
ran on a synthesized input
Eacient/EfficientAD/efficientad.py
code served (permissive licence) · get_code("27ada34ea43ef9cb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 5, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

out_channels = 384

# Define minimal models that satisfy how they're used in predict()
class TeacherModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(16, out_channels)
    
    def forward(self, x):
        # x shape: (batch, channels, height, width)
        # Flatten and pass through linear layer
        batch_size = x.shape[0]
        x_flat = x.view(batch_size, -1)
        return self.linear(x_flat).view(batch_size, out_channels, 1, 1)

class StudentModel(nn.Module):
    def __init__(self):
        super().__init__()
        # Student outputs concatenated teacher and autoencoder channels
        self.linear = nn.Linear(16, out_channels + 256)
    
    def forward(self, x):
        batch_size = x.shape[0]
        x_flat = x.view(batch_size, -1)
        return self.linear(x_flat).view(batch_size, out_channels + 256, 1, 1)

class AutoencoderModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(16, 256)
    
    def forward(self, x):
        batch_size = x.shape[0]
        x_flat = x.view(batch_size, -1)
        return self.linear(x_flat).view(batch_size, 256, 1, 1)

# Create model instances
teacher = TeacherModel()
student = StudentModel()
autoencoder = AutoencoderModel()

# Create small input image tensor (batch_size=2, channels=1, height=4, width=4)
image = torch.randn(2, 1, 4, 4)

# Create normalization statistics
teacher_mean = torch.randn(1, out_channels, 1, 1)
teacher_std = torch.ones(1, out_channels, 1, 1) * 0.5

# Create quantization parameters
q_st_start = torch.tensor(0.1)
q_st_end = torch.tensor(0.9)
q_ae_start = torch.tensor(0.2)
q_ae_end = torch.tensor(0.8)

ARGS = {
    'image': image,
    'teacher': teacher,
    'student': student,
    'autoencoder': autoencoder,
    'teacher_mean': teacher_mean,
    'teacher_std': teacher_std,
    'q_st_start': q_st_start,
    'q_st_end': q_st_end,
    'q_ae_start': q_ae_start,
    'q_ae_end': q_ae_end,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 5, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
read_tiff Ran
ran, honoured the contract we drafted
henry1985/EfficientAD/mvtec_ad_evaluation/generic_util.py
code served (permissive licence) · get_code("4986e9bea3ab5f62")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family int, shape (10, 10) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import tempfile
import numpy as np
import tifffile as tiff

# Create a temporary TIFF file for testing
temp_dir = tempfile.mkdtemp()
test_image = np.random.randint(0, 256, (10, 10), dtype=np.uint8)
temp_file_path = os.path.join(temp_dir, "test_image.tif")
tiff.imwrite(temp_file_path, test_image)

# Remove the extension to get the path without extension
file_path_no_ext = os.path.join(temp_dir, "test_image")

ARGS = {
    "file_path_no_ext": file_path_no_ext,
    "exts": ('.tif', '.tiff', '.TIF', '.TIFF')
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tifffile — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family int, shape (10, 10) — shape (10, 10) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
split_dataset Ran
ran on a synthesized input
LeapMind/PUAD/puad/dataset.py
code served (permissive licence) · get_code("079e540378c4e38e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from PIL import Image
from pathlib import Path
import tempfile
import os

torch.manual_seed(0)

# Create a temporary directory with some dummy PNG images
temp_dir = tempfile.mkdtemp()

# Create 5 small dummy PNG images
for i in range(5):
    img = Image.new('RGB', (4, 3), color=(i*50, i*50, i*50))
    img.save(os.path.join(temp_dir, f'image_{i}.png'))

# Define simple transform functions
def transform_1(img):
    if isinstance(img, Image.Image):
        img = np.array(img)
    return img / 255.0

def transform_2(img):
    if isinstance(img, Image.Image):
        img = np.array(img)
    return img.astype(np.float32)

ARGS = {
    'img_dir': temp_dir,
    'split_ratio': 0.6,
    'transform_1': transform_1,
    'transform_2': transform_2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
stg2_transform Ran
ran on a synthesized input
cinout/EfficientAD/efficientad_twosteps.py
code served (permissive licence) · get_code("1a23741c704a331b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Compose. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from torchvision import transforms

torch.manual_seed(0)

ARGS = {
    "size": 224
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Compose — a Compose output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Compose output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
test Ran
ran on a synthesized input
Eacient/EfficientAD/efficientad.py
code served (permissive licence) · get_code("21a6b1479ce8651c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import numpy as np
from PIL import Image
from io import BytesIO

torch.manual_seed(0)

# Create mock models
class MockTeacher(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv = nn.Conv2d(3, 384, 1)
    
    def forward(self, x):
        return self.conv(x)

class MockStudent(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv = nn.Conv2d(3, 768, 1)  # 384 + 384
    
    def forward(self, x):
        return self.conv(x)

class MockAutoencoder(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv = nn.Conv2d(3, 384, 1)
    
    def forward(self, x):
        return self.conv(x)

# Create mock test dataset
class MockImage:
    def __init__(self, width=256, height=256):
        self.width = width
        self.height = height
    
    def __getitem__(self, key):
        # Mock PIL Image behavior
        return self

# Create test set with mock data
def create_mock_test_set(num_samples=2):
    test_set = []
    for i in range(num_samples):
        # Create a simple PIL Image
        img_array = np.random.rand(256, 256, 3) * 255
        pil_img = Image.fromarray(img_array.astype(np.uint8))
        target = i % 2
        path = f"/mock/path/good/image_{i}.png" if i % 2 == 0 else f"/mock/path/defect/image_{i}.png"
        test_set.append((pil_img, target, path))
    return test_set

# Initialize models
teacher = MockTeacher()
student = MockStudent()
autoencoder = MockAutoencoder()

# Create stats tensors
teacher_mean = torch.tensor([[[[0.1]]]], dtype=torch.float32)
teacher_std = torch.tensor([[[[0.05]]]], dtype=torch.float32)

# Quantile values
q_st_start = torch.tensor(0.1)
q_st_end = torch.tensor(0.9)
q_ae_start = torch.tensor(0.1)
q_ae_end = torch.tensor(0.9)

# Create test set
test_set = create_mock_test_set(2)

ARGS = {
    'test_set': test_set,
    'teacher': teacher,
    'student': student,
    'autoencoder': autoencoder,
    'teacher_mean': teacher_mean,
    'teacher_std': teacher_std,
    'q_st_start': q_st_start,
    'q_st_end': q_st_end,
    'q_ae_start': q_ae_start,
    'q_ae_end': q_ae_end,
    'test_output_dir': None,
    'desc': 'Running inference'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, sklearn, tifffile, torch, torchvision, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
test Ran
ran on a synthesized input
danielsoy/EfficientAD-1/efficientaddrive.py
code served (permissive licence) · get_code("fc52334326eef520")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import numpy as np
from PIL import Image
from io import BytesIO

torch.manual_seed(0)

# Create minimal models that satisfy the function's usage
class TeacherModel(nn.Module):
    def forward(self, x):
        # Returns tensor of shape (batch, 384, h, w)
        batch_size = x.shape[0]
        return torch.randn(batch_size, 384, 32, 32)

class StudentModel(nn.Module):
    def forward(self, x):
        # Returns tensor of shape (batch, 768, h, w) - 384 for teacher, 384 for autoencoder
        batch_size = x.shape[0]
        return torch.randn(batch_size, 768, 32, 32)

class AutoencoderModel(nn.Module):
    def forward(self, x):
        # Returns tensor of shape (batch, 384, h, w)
        batch_size = x.shape[0]
        return torch.randn(batch_size, 384, 32, 32)

# Create dummy PIL images
def create_dummy_image(width=100, height=120):
    img = Image.new('RGB', (width, height), color='red')
    return img

# Create test dataset as list of tuples (image, target, path)
test_set = [
    (create_dummy_image(100, 120), 0, "/data/good/image_0.jpg"),
    (create_dummy_image(110, 130), 1, "/data/defect_class_A/image_1.jpg"),
]

# Create models
teacher = TeacherModel()
student = StudentModel()
autoencoder = AutoencoderModel()

# Create teacher statistics
teacher_mean = torch.randn(1, 384, 1, 1)
teacher_std = torch.ones(1, 384, 1, 1) * 0.5

# Quantile values for normalization
q_st_start = torch.tensor(0.1)
q_st_end = torch.tensor(2.0)
q_ae_start = torch.tensor(0.15)
q_ae_end = torch.tensor(2.5)

ARGS = {
    'test_set': test_set,
    'teacher': teacher,
    'student': student,
    'autoencoder': autoencoder,
    'teacher_mean': teacher_mean,
    'teacher_std': teacher_std,
    'q_st_start': q_st_start,
    'q_st_end': q_st_end,
    'q_ae_start': q_ae_start,
    'q_ae_end': q_ae_end,
    'test_output_dir': None,
    'desc': 'Running inference',
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, sklearn, tifffile, torch, torchvision, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
train_transform Ran
ran on a synthesized input
Eacient/EfficientAD/efficientad.py
code served (permissive licence) · get_code("65449a6185e6dc7f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 4, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from PIL import Image
import numpy as np

# Create a small test image
torch.manual_seed(0)
image_array = np.random.randint(0, 256, (64, 64, 3), dtype=np.uint8)
test_image = Image.fromarray(image_array)

ARGS = {
    "image": test_image
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 4, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
train_transform Ran
ran on a synthesized input
Eacient/EfficientAD/pretraining.py
code served (permissive licence) · get_code("077ad902098508f5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

from PIL import Image
import torch
import numpy as np

torch.manual_seed(0)

# Create a small PIL Image to use as input
# The train_transform function expects a PIL Image as input
image_array = np.random.randint(0, 256, (64, 64, 3), dtype=np.uint8)
pil_image = Image.fromarray(image_array)

ARGS = {
    "image": pil_image
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
train_transform Ran
ran on a synthesized input
Zaza-97/EfficientAD/efficientad.py
code served (permissive licence) · get_code("a213bdb9746b0401")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 4, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from PIL import Image
import numpy as np

# Create a small test image
torch.manual_seed(0)
np.random.seed(0)

# Create a simple RGB image (PIL Image object is what the transform expects)
img_array = np.random.randint(0, 256, (100, 100, 3), dtype=np.uint8)
test_image = Image.fromarray(img_array)

ARGS = {
    "image": test_image
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 4, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
train_transform Ran
ran on a synthesized input
Zaza-97/EfficientAD/pretraining.py
code served (permissive licence) · get_code("08b41ec7d5727026")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from PIL import Image
import numpy as np
from torchvision import transforms

torch.manual_seed(0)

# Create a small test image
img_array = np.random.randint(0, 256, (64, 64, 3), dtype=np.uint8)
image = Image.fromarray(img_array)

ARGS = {
    "image": image
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
train_transform Ran
ran on a synthesized input
cinout/EfficientAD/efficientad_twosteps.py
code served (permissive licence) · get_code("b831876f274e1ec4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 4, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from torchvision import transforms
from PIL import Image
import numpy as np

torch.manual_seed(0)

# Create a small PIL Image as a stand-in for an image
# The function expects a PIL Image since transforms.Compose expects PIL images
img_array = np.random.randint(0, 256, (64, 64, 3), dtype=np.uint8)
image = Image.fromarray(img_array)

# Create a minimal config dict
config = {}

ARGS = {
    "image": image,
    "config": config,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 4, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
train_transform Ran
ran on a synthesized input
cinout/EfficientAD/pretraining.py
code served (permissive licence) · get_code("d1db9216b1ac0ae2")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

from PIL import Image
import torch
import numpy as np

torch.manual_seed(0)

# Create a small PIL Image object as input
# The function expects a PIL Image since it uses torchvision transforms
image_array = np.random.randint(0, 256, (64, 64, 3), dtype=np.uint8)
image = Image.fromarray(image_array)

# Define the size parameter
size = 224

ARGS = {
    "image": image,
    "size": size
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
trapezoid Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
henry1985/EfficientAD/mvtec_ad_evaluation/generic_util.py
code served (permissive licence) · get_code("92db361050fcd08d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float64, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create simple test data for trapezoid integration
x = np.array([0.0, 1.0, 2.0, 3.0, 4.0, 5.0])
y = np.array([0.0, 1.0, 2.0, 3.0, 4.0, 5.0])

ARGS = {
    'x': x,
    'y': y,
    'x_max': 3.5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
inference Not yet run
unverified (harvested, no recorded run)
ntkhoa95/EfficientAD/inference.py
code served (permissive licence) · get_code("8766003511e1dc5c")
How it ran

no invocation recorded.

inference_onnx Not yet run
unverified (harvested, no recorded run)
ntkhoa95/EfficientAD/inference.py
code served (permissive licence) · get_code("dfe0b32f2056683b")
How it ran

no invocation recorded.

lid_mle_modified Not yet run
unverified (harvested, no recorded run)
cinout/EfficientAD/efficientad.py
code served (permissive licence) · get_code("e5349e913e0cf837")
How it ran

no invocation recorded.

load_model Not yet run
unverified (harvested, no recorded run)
ntkhoa95/EfficientAD/inference.py
code served (permissive licence) · get_code("a849040c6073d454")
How it ran

no invocation recorded.

map_normalization Not yet run
unverified (harvested, no recorded run)
dellysursh/EfficientAD/efficientad.py
code served (permissive licence) · get_code("23bcd10959f6f3db")
How it ran

no invocation recorded.

test Not yet run
unverified (harvested, no recorded run)
Zaza-97/EfficientAD/efficientad.py
code served (permissive licence) · get_code("bde900c03717312f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 35 samples lifted from this paper's linked repositories, 35 carry a function identity and 0 do not. Of the 33 distinct functions with an identity, 4 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 2 later) and 29 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
trapezoid 2 other papers
1 dated earlier, 1 later
2205.00908 (2022-05)
MemSeg: A semi-supervised method for image surface defect detection using differences and commonalities
2405.14529 (2024-05)
AnomalyDINO: Boosting Patch-based Few-shot Anomaly Detection with DINOv2
compute_pro 1 other paper
1 dated earlier
2205.00908 (2022-05)
MemSeg: A semi-supervised method for image surface defect detection using differences and commonalities
generate_toy_dataset 1 other paper
1 dated earlier
2205.00908 (2022-05)
MemSeg: A semi-supervised method for image surface defect detection using differences and commonalities
read_tiff 1 other paper
1 later
2405.14529 (2024-05)
AnomalyDINO: Boosting Patch-based Few-shot Anomaly Detection with DINOv2

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

More are linked than shown here.

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Detecting anomalies in images is an important task, especially in real-time computer vision applications. In this work, we focus on computational efficiency and propose a lightweight feature extractor that processes an image in less than a millisecond on a modern GPU. We then use a student-teacher approach to detect anomalous features. We train a student network to predict the extracted features of normal, i.e., anomaly-free training images. The detection of anomalies at test time is enabled by the student failing to predict their features. We propose a training loss that hinders the student from imitating the teacher feature extractor beyond the normal images. It allows us to drastically reduce the computational cost of the student-teacher model, while improving the detection of anomalous features. We furthermore address the detection of challenging logical anomalies that involve invalid combinations of normal local features, for example, a wrong ordering of objects. We detect these anomalies by efficiently incorporating an autoencoder that analyzes images globally. We evaluate our method, called EfficientAD, on 32 datasets from three industrial anomaly detection dataset collections. EfficientAD sets new standards for both the detection and the localization of anomalies. At a latency of two milliseconds and a throughput of six hundred images per second, it enables a fast handling of anomalies. Together with its low error rate, this makes it an economical solution for real-world applications and a fruitful basis for future research.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2303.14535")
get_code_for_paper("2303.14535")
have("2303.14535")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2303.14535.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2303.14535.svg)](https://syntology.ai/paper/2303.14535)

Connect an agent — have() is free.