SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2106.08265 · 2021

Towards Total Recall in Industrial Anomaly Detection

arXiv · PDF · Open in the Atlas

Code that ran

28 of 36 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, 1 violated it and 21 have no contract verdict; 5 failures of our instrument; 8 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/2106.08265.json · badge: /api/ran/2106.08265.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
amazon-research/patchcore-inspection canonical (classifier label)
classifier basis: census
4 ran · 1 no recorded run
JoegameZhou/PatchCore community (classifier label)
classifier basis not recorded on the link
6 ran · 0 no recorded run
rvorias/ind_knn_ad community (classifier label)
classifier basis not recorded on the link
5 ran · 2 no recorded run
tbcvContributor/DeepHawkeye community (classifier label)
classifier basis not recorded on the link
4 ran · 3 no recorded run
any-tech/PatchCore-ex community (classifier label)
classifier basis not recorded on the link
4 ran · 0 no recorded run
Ultranity/Anomaly.Paddle community (classifier label)
classifier basis not recorded on the link
3 ran · 0 no recorded run
tiskw/patchcore-ad community (classifier label)
classifier basis not recorded on the link
1 ran · 1 no recorded run
amazon-science/patchcore-inspection community (classifier label)
classifier basis: plan_row
1 ran · 1 no recorded run
FunctionStatusWhere it lives
assemble_patch Ran
ran on a synthesized input
any-tech/PatchCore-ex/utils/visualize.py
code served (permissive licence) · get_code("02bea3555bf26ceb")
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 3, dtype family int, shape (8, 12, 3) 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 numpy as np

# Set up seed for reproducibility
np.random.seed(0)

# Create a small coreset of image patches
# imgs_coreset needs to be indexable and have shape[1] as the patch size
# We'll create 6 patches of size 4x4 with 3 channels (RGB)
size_receptive = 4
num_patches = 6
imgs_coreset = np.random.randint(0, 256, size=(num_patches, size_receptive, size_receptive, 3), dtype=np.uint8)

# Create index patch - indices into imgs_coreset
# For a 2x3 grid, we need 6 patches
idx_patch = [0, 1, 2, 3, 4, 5]

# HW_map defines the height and width of the grid in terms of patches
# [2, 3] means 2 rows, 3 columns of patches
HW_map = [2, 3]

ARGS = {
    "idx_patch": idx_patch,
    "imgs_coreset": imgs_coreset,
    "HW_map": HW_map,
}
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 ndarray, ndim 3, dtype family int, shape (8, 12, 3) — shape (8, 12, 3) 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
auto_threshold Ran
ran on a synthesized input
tiskw/patchcore-ad/patchcore/utils.py
code served (permissive licence) · get_code("31bb4bbf1cab798a")
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 1, 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

# Set random seed for reproducibility
np.random.seed(0)

# Create a list of anomaly scores for good samples
# Using a small but realistic set of scores
scores_good = [0.1, 0.15, 0.12, 0.18, 0.14, 0.16, 0.13, 0.17]

# Hyperparameter for thresholding (coefficient of standard deviation)
coef_sigma = 2.5

ARGS = {
    "scores_good": scores_good,
    "coef_sigma": coef_sigma,
}
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 1, 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
calc_imagewise_metrics Ran
ran on a synthesized input
any-tech/PatchCore-ex/utils/metrics.py
code served (permissive licence) · get_code("d64d475597e3e18e")
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 numpy as np

# Analyzing the function:
# - D is a dict where keys are type strings (e.g., 'good', 'defect')
# - D[type_test] is a list of items
# - Each item D[type_test][i] is array-like with a max() method
# - type_normal is a string used for comparison
# - The function iterates through all keys and computes metrics

# Create sample anomaly detection data
# Structure: dict with type names as keys, each containing list of score arrays
D = {
    'good': [
        np.array([0.1, 0.2, 0.15]),  # normal samples - low anomaly scores
        np.array([0.12, 0.18, 0.11]),
    ],
    'defect': [
        np.array([0.7, 0.8, 0.75]),  # anomalous samples - high anomaly scores
        np.array([0.68, 0.82, 0.76]),
    ],
    'crack': [
        np.array([0.65, 0.78, 0.72]),
        np.array([0.71, 0.79, 0.74]),
    ],
}

ARGS = {
    'D': D,
    'type_normal': 'good',
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn, tqdm — 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
calc_pixelwise_metrics Ran
ran on a synthesized input
any-tech/PatchCore-ex/utils/metrics.py
code served (permissive licence) · get_code("e6b66178d86edc78")
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 numpy as np

# Analyze the function:
# - D is a dict with keys being test types
# - D[type_test] is a list where each element D[type_test][i] is array-like (flattened to 1D)
# - y has the same structure as D
# - The function iterates over D.keys() and accesses D[type_test][i] and y[type_test][i]
# - These are flattened and used with sklearn metrics (ROC, precision-recall)

# Create small test data
np.random.seed(0)

# Create D: dict with test types, each containing list of score/distance arrays
D = {
    'test_type_1': [
        np.random.rand(12).astype(np.float32),  # 3x4 flattened scores
        np.random.rand(12).astype(np.float32),
    ],
    'test_type_2': [
        np.random.rand(12).astype(np.float32),
        np.random.rand(12).astype(np.float32),
    ]
}

# Create y: dict with same structure, containing binary labels
y = {
    'test_type_1': [
        np.random.randint(0, 2, 12).astype(np.int32),
        np.random.randint(0, 2, 12).astype(np.int32),
    ],
    'test_type_2': [
        np.random.randint(0, 2, 12).astype(np.int32),
        np.random.randint(0, 2, 12).astype(np.int32),
    ]
}

ARGS = {
    'D': D,
    'y': y,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn, tqdm — 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
compute_and_store_final_results Ran
ran on a synthesized input
amazon-research/patchcore-inspection/src/patchcore/utils.py
code served (permissive licence) · get_code("e80ac3c0c9f85f59")
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 dict. 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 tempfile
import os
import numpy as np

# Create a temporary directory for results
temp_dir = tempfile.mkdtemp()

# Define arguments for compute_and_store_final_results
ARGS = {
    'results_path': temp_dir,
    'results': [
        [0.85, 0.78, 0.92, 0.88, 0.91],
        [0.82, 0.75, 0.89, 0.86, 0.88],
        [0.90, 0.83, 0.95, 0.91, 0.94],
    ],
    'row_names': ['Dataset_A', 'Dataset_B', 'Dataset_C'],
    'column_names': ['Instance AUROC', 'Full Pixel AUROC', 'Full PRO', 'Anomaly Pixel AUROC', 'Anomaly PRO']
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
compute_imagewise_retrieval_metrics Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
amazon-research/patchcore-inspection/src/patchcore/metrics.py
code served (permissive licence) · get_code("9a6ba99206d2a918")
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 dict. 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 numpy as np
from sklearn import metrics

# Set random seed for reproducibility
np.random.seed(0)

# Create small sample data
num_images = 8

# Anomaly prediction weights - continuous scores indicating probability of anomaly
# Higher values indicate higher probability of being an anomaly
anomaly_prediction_weights = np.array([0.1, 0.3, 0.7, 0.9, 0.2, 0.6, 0.8, 0.4])

# Binary ground truth labels - 1 for anomaly, 0 for normal
anomaly_ground_truth_labels = np.array([0, 0, 1, 1, 0, 1, 1, 0])

ARGS = {
    'anomaly_prediction_weights': anomaly_prediction_weights,
    'anomaly_ground_truth_labels': anomaly_ground_truth_labels,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
compute_pixelwise_retrieval_metrics Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
amazon-research/patchcore-inspection/src/patchcore/metrics.py
code served (permissive licence) · get_code("45cfbfc30f32be75")
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 dict. 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 numpy as np

# Create small anomaly segmentation masks (2 images, 4x3 pixels each)
anomaly_segmentations = np.array([
    [[0.1, 0.2, 0.3],
     [0.4, 0.5, 0.6],
     [0.7, 0.8, 0.9],
     [0.2, 0.3, 0.4]],
    [[0.15, 0.25, 0.35],
     [0.45, 0.55, 0.65],
     [0.75, 0.85, 0.95],
     [0.25, 0.35, 0.45]]
], dtype=np.float32)

# Create corresponding ground truth masks (2 images, 4x3 pixels each)
ground_truth_masks = np.array([
    [[0, 0, 1],
     [1, 1, 0],
     [1, 0, 1],
     [0, 1, 0]],
    [[0, 1, 1],
     [0, 1, 1],
     [1, 1, 0],
     [1, 0, 1]]
], dtype=np.int32)

ARGS = {
    "anomaly_segmentations": anomaly_segmentations,
    "ground_truth_masks": ground_truth_masks
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
conv1x1 Ran
ran; our contract draft was wrong, not the code
tbcvContributor/DeepHawkeye/src/wide_res_model.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from medaitech/scrd4ad, is pointer only (licence: NONE) · get_code("2a80220dabcb742a")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from medaitech/scrd4ad, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

conv3x3 Ran
ran; our contract draft was wrong, not the code
tbcvContributor/DeepHawkeye/src/wide_res_model.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from medaitech/scrd4ad, is pointer only (licence: NONE) · get_code("600ff2c45e0de056")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from medaitech/scrd4ad, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

createDatasetJson Ran
ran on a synthesized input
JoegameZhou/PatchCore/src/dataset.py
code served (permissive licence) · get_code("b8c46d57235fa543")
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 1, 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 os
import tempfile
import shutil
from PIL import Image
import numpy as np
from torchvision import transforms

# Create a temporary directory structure mimicking MVTec dataset
temp_dir = tempfile.mkdtemp()
category = "test_category"
category_dir = os.path.join(temp_dir, category)
os.makedirs(category_dir)

# Create train directory with good samples
train_dir = os.path.join(category_dir, "train")
os.makedirs(train_dir)
train_good_dir = os.path.join(train_dir, "good")
os.makedirs(train_good_dir)

# Create some dummy images for training
for i in range(2):
    img = Image.new('RGB', (64, 64), color=(73, 109, 137))
    img.save(os.path.join(train_good_dir, f"good_{i}.png"))

# Create test directory with good and defective samples
test_dir = os.path.join(category_dir, "test")
os.makedirs(test_dir)
test_good_dir = os.path.join(test_dir, "good")
os.makedirs(test_good_dir)

test_defect_dir = os.path.join(test_dir, "defect")
os.makedirs(test_defect_dir)

# Create ground truth directory
gt_dir = os.path.join(category_dir, "ground_truth")
os.makedirs(gt_dir)
gt_defect_dir = os.path.join(gt_dir, "defect")
os.makedirs(gt_defect_dir)

# Create test good samples
for i in range(2):
    img = Image.new('RGB', (64, 64), color=(73, 109, 137))
    img.save(os.path.join(test_good_dir, f"good_{i}.png"))

# Create test defective samples and corresponding ground truth
for i in range(2):
    img = Image.new('RGB', (64, 64), color=(200, 50, 50))
    img.save(os.path.join(test_defect_dir, f"defect_{i}.png"))
    
    gt_img = Image.new('L', (64, 64), color=128)
    gt_img.save(os.path.join(gt_defect_dir, f"defect_{i}.png"))

# Define simple transforms
data_transforms = transforms.Compose([
    transforms.Resize((64, 64)),
    transforms.ToTensor(),
])

gt_transforms = transforms.Compose([
    transforms.Resize((64, 64)),
    transforms.ToTensor(),
])

ARGS = {
    "dataset_path": temp_dir,
    "category": category,
    "data_transforms": data_transforms,
    "gt_transforms": gt_transforms,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, 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
create_dataset Ran
ran on a synthesized input
rvorias/ind_knn_ad/indad/workspace.py
code served (permissive licence) · get_code("774c2acb59a77761")
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 PosixPath. 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 tempfile
from pathlib import Path

# Create a temporary directory to use as parent
temp_dir = tempfile.mkdtemp()

ARGS = {
    'parent': temp_dir,
    'name': 'test-dataset-001'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PosixPath — a PosixPath output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PosixPath 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
create_storage_folder Ran
ran on a synthesized input
amazon-research/patchcore-inspection/src/patchcore/utils.py
code served (permissive licence) · get_code("4847c26291a5d907")
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 str. 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 os
import tempfile

# Create a temporary directory for testing
temp_base = tempfile.mkdtemp()

ARGS = {
    'main_folder_path': temp_base,
    'project_folder': 'test_project',
    'group_folder': 'test_group',
    'mode': 'iterate'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
cvt2heatmap Ran
ran on a synthesized input
tbcvContributor/DeepHawkeye/src/utils.py
code served (permissive licence) · get_code("cd61b6846e7dd644")
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 3, dtype family int, shape (4, 3, 3) 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 cv2
import numpy as np

# Create a small grayscale image as input
# The function expects a numpy array that can be converted to uint8
# Using a small 4x3 array to keep it tiny
gray_image = np.random.rand(4, 3) * 255

ARGS = {
    "gray": gray_image
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family int, shape (4, 3, 3) — shape (4, 3, 3) 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
embedding_concat Ran
ran on a synthesized input
JoegameZhou/PatchCore/src/operator.py
code served (permissive licence) · get_code("40df71d26759ce01")
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 4, dtype family float, shape (2, 7, 8, 8) 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 numpy as np

np.random.seed(0)

# Create two feature maps with compatible shapes
# x will have shape (batch, channels1, height1, width1)
# y will have shape (batch, channels2, height2, width2)
# For embedding_concat to work, height1 and width1 must be divisible by height2 and width2
# Let's make x be 2x upsampled relative to y

batch_size = 2
channels1 = 4
channels2 = 3
height2 = 4
width2 = 4
s = 2  # scale factor

height1 = height2 * s
width1 = width2 * s

x = np.random.randn(batch_size, channels1, height1, width1).astype(np.float32)
y = np.random.randn(batch_size, channels2, height2, width2).astype(np.float32)

ARGS = {
    "x": x,
    "y": y
}
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 ndarray, ndim 4, dtype family float, shape (2, 7, 8, 8) — shape (2, 7, 8, 8) 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
fold Ran
ran on a synthesized input
JoegameZhou/PatchCore/src/operator.py
code served (permissive licence) · get_code("b4bfdc071e0f7908")
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 4, dtype family float, shape (2, 3, 5, 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 numpy as np
import torch

torch.manual_seed(0)

# The fold function takes:
# - col: a numpy array of shape (batch_num, channel, kernel_size, kernel_size, out_h, out_w)
#        which will be reshaped from input col
# - input_shape: tuple of (batch_num, channel, height, width)
# - kernel_size: int
# - stride: int (default 1)
# - pad: int (default 0)

# Let's construct valid arguments:
batch_num = 2
channel = 3
height = 5
width = 4
kernel_size = 3
stride = 1
pad = 0

# Calculate expected output dimensions
out_h = (height + pad + pad - kernel_size) // stride + 1
out_w = (width + pad + pad - kernel_size) // stride + 1

# col should have shape (batch_num, channel, kernel_size, kernel_size, out_h, out_w)
# but it's passed as a flattened array that will be reshaped
col_shape = (batch_num, channel, kernel_size, kernel_size, out_h, out_w)
col = np.random.randn(*col_shape).astype(np.float32)

input_shape = (batch_num, channel, height, width)

ARGS = {
    'col': col,
    'input_shape': input_shape,
    'kernel_size': kernel_size,
    'stride': stride,
    'pad': pad
}
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 ndarray, ndim 4, dtype family float, shape (2, 3, 5, 4) — shape (2, 3, 5, 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
import_images Ran
ran on a synthesized input
rvorias/ind_knn_ad/indad/workspace.py
code served (permissive licence) · get_code("20c1c0be389a566e")
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 list, ndim 1, 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 io
from pathlib import Path
from tempfile import TemporaryDirectory
from PIL import Image

# Create a temporary dataset directory structure
temp_root = TemporaryDirectory()
root_path = Path(temp_root.name)

# Create the required train/good directory structure
train_good_dir = root_path / 'train' / 'good'
train_good_dir.mkdir(parents=True, exist_ok=True)

# Create a simple valid PNG image in memory
def create_test_image():
    img = Image.new('RGB', (10, 10), color='red')
    img_bytes = io.BytesIO()
    img.save(img_bytes, format='PNG')
    return img_bytes.getvalue()

# Create test image bytes
test_image_bytes = create_test_image()

# Create files list with valid image data
files = [
    ('image1.png', test_image_bytes),
    ('image2.jpg', test_image_bytes),
]

ARGS = {
    'root': root_path,
    'files': files,
    'split': 'train',
    'label': 'good'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list 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
inspect_dataset Ran
ran on a synthesized input
rvorias/ind_knn_ad/indad/workspace.py
code served (permissive licence) · get_code("b21c2ea9ce7a27e6")
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 dict. 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 tempfile
from pathlib import Path

# Create a temporary directory structure that mimics a valid dataset
temp_dir = tempfile.TemporaryDirectory()
root_path = Path(temp_dir.name)

# Create train/good directory with a sample image
train_good_dir = root_path / 'train' / 'good'
train_good_dir.mkdir(parents=True, exist_ok=True)

# Create a simple test image using PIL
from PIL import Image
import io

# Create a small valid PNG image
img = Image.new('RGB', (64, 64), color='red')
img_path = train_good_dir / 'sample_good.png'
img.save(img_path)

# Create test directory with a defect label
test_defect_dir = root_path / 'test' / 'defect'
test_defect_dir.mkdir(parents=True, exist_ok=True)

# Create a test image with defects
test_img = Image.new('RGB', (64, 64), color='blue')
test_img_path = test_defect_dir / 'sample_defect.png'
test_img.save(test_img_path)

# Create ground_truth directory with matching mask
gt_dir = root_path / 'ground_truth' / 'defect'
gt_dir.mkdir(parents=True, exist_ok=True)

# Create a binary mask image (0 for healthy, 255 for defects)
mask_img = Image.new('L', (64, 64), color=0)
# Add some defect pixels
pixels = mask_img.load()
for x in range(10, 20):
    for y in range(10, 20):
        pixels[x, y] = 255
mask_path = gt_dir / 'sample_defect_mask.png'
mask_img.save(mask_path)

# Add another healthy training image to meet minimum requirement
img2 = Image.new('RGB', (64, 64), color='green')
img2_path = train_good_dir / 'sample_good2.png'
img2.save(img2_path)

ARGS = {
    'root': root_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
johnson_lindenstrauss_min_dim Ran
ran on a synthesized input
Ultranity/Anomaly.Paddle/dim_reduction/random_projection.py
code served (permissive licence) · get_code("0a43d57bcdbc3765")
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 int64, ndim 0, dtype family int, shape () 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 numpy as np

# The function takes n_samples (int) and eps (float, optional)
# It performs mathematical operations on these scalars
# n_samples: number of samples
# eps: minimum distortion rate (default 0.1)

ARGS = {
    "n_samples": 100,
    "eps": 0.1,
}
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 int64, ndim 0, dtype family int, 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
list_changes Ran
ran on a synthesized input
rvorias/ind_knn_ad/indad/curation.py
code served (permissive licence) · get_code("f72e12b0cce93f61")
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 list, ndim 1, 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 json
import tempfile
from pathlib import Path

# Create a temporary directory to serve as root
temp_dir = tempfile.mkdtemp()
root_path = Path(temp_dir)

# Create the .indad/history directory structure
history_dir = root_path / '.indad' / 'history'
history_dir.mkdir(parents=True, exist_ok=True)

# Create some sample history JSON files
record1 = {
    'id': '001',
    'created_at': '2024-01-01T10:00:00',
    'action': 'add',
    'description': 'Initial commit'
}

record2 = {
    'id': '002',
    'created_at': '2024-01-01T10:05:00',
    'action': 'modify',
    'description': 'Updated file'
}

record3 = {
    'id': '003',
    'created_at': '2024-01-01T10:10:00',
    'action': 'undo',
    'undo_of': '001',
    'description': 'Undo initial commit'
}

# Write the records to JSON files
(history_dir / '001.json').write_text(json.dumps(record1))
(history_dir / '002.json').write_text(json.dumps(record2))
(history_dir / '003.json').write_text(json.dumps(record3))

ARGS = {
    'root': root_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list 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
min_max_norm Ran
ran on a synthesized input
tbcvContributor/DeepHawkeye/src/utils.py
code served (permissive licence) · get_code("373674457d45997f")
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 4, dtype family float, shape (2, 4, 3, 5) 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)

# The function takes an image tensor and applies min-max normalization
# It calls: image.min(), image.max(), and performs arithmetic operations
# The image should be a torch tensor

image = torch.randn(2, 4, 3, 5)  # Small tensor: batch=2, channels=4, height=3, width=5

ARGS = {
    "image": image
}
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 4, dtype family float, shape (2, 4, 3, 5) — shape (2, 4, 3, 5) 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
normalize Ran
ran on a synthesized input
JoegameZhou/PatchCore/postprocess.py
code served (permissive licence) · get_code("c3cae68ec9e6850c")
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 3, dtype family float, shape (4, 3, 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 numpy as np

# Create small sample data for the normalize function
# input_ should be a numpy array with shape (C, H, W) based on reshape operations in the function
input_array = np.random.randn(4, 3, 2).astype(np.float32)

# mean_ should be a list/array-like with C elements (matches first dimension)
mean_values = [0.5, 0.3, 0.2, 0.1]

# std_ should be a list/array-like with C elements (matches first dimension)
std_values = [0.2, 0.15, 0.25, 0.18]

ARGS = {
    "input_": input_array,
    "mean_": mean_values,
    "std_": std_values,
}
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 ndarray, ndim 3, dtype family float, shape (4, 3, 2) — shape (4, 3, 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
overlay_heatmap_on_image Ran
ran on a synthesized input
any-tech/PatchCore-ex/utils/visualize.py
code served (permissive licence) · get_code("591e30226a9f25b0")
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 3, dtype family int, shape (32, 48, 3) 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 numpy as np
import cv2

# Create a small test image (RGB format, values 0-255)
img = np.random.randint(0, 256, size=(32, 48, 3), dtype=np.uint8)

# Create a small heatmap (grayscale, values 0-1)
heatmap = np.random.rand(32, 48).astype(np.float32)

# Set the ratio for blending
ratio_img = 0.5

ARGS = {
    "img": img,
    "heatmap": heatmap,
    "ratio_img": ratio_img
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family int, shape (32, 48, 3) — shape (32, 48, 3) 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
replace_self Ran
ran on a synthesized input
JoegameZhou/PatchCore/src/pthtockpt.py
code served (permissive licence) · get_code("ddeed4d4fc8e73b2")
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 str. 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

torch.manual_seed(0)

ARGS = {
    "name1": "hello_world_test",
    "str1": "world",
    "str2": "python"
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
rescale Ran
ran, honoured the contract we drafted
Ultranity/Anomaly.Paddle/utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from JuanFMontesinos/Acappella-YNet, is pointer only (licence: NONE) · get_code("f51e6ad9c7104a5a")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from JuanFMontesinos/Acappella-YNet, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

serialize_results Ran
ran on a synthesized input
rvorias/ind_knn_ad/indad/utils.py
code served (permissive licence) · get_code("af18bba97264c730")
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 str. 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

torch.manual_seed(0)

# Construct a results dict
# The function expects keys (strings) and values that are indexable with [0] and [1]
# and can be multiplied by 100 and formatted with .1f
results = {
    'accuracy': [0.856, 0.923],
    'precision': [0.742, 0.891],
    'recall': [0.715, 0.867],
}

ARGS = {
    'results': results,
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
set_torch_device Ran
ran; our contract draft was wrong, not the code
amazon-science/patchcore-inspection/src/patchcore/utils.py
code served (permissive licence) · get_code("61fd3c8459a48853")
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 device. 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

torch.manual_seed(0)

# The function takes gpu_ids as a parameter
# It checks len(gpu_ids) and uses gpu_ids[0] if the list is non-empty
# We'll test with an empty list (CPU case)

ARGS = {
    'gpu_ids': []
}
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 device — a device output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a device 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
str2bool Ran
ran, violated the contract we drafted
Ultranity/Anomaly.Paddle/infer.py
code served (permissive licence) · get_code("7c508037b40522af")
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) and returned bool, ndim 0, dtype family float, shape () 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 argparse

def str2bool(v):
    if isinstance(v, bool):
        return v
    if v.lower() in ('yes', 'true', 't', 'y', '1'):
        return True
    elif v.lower() in ('no', 'false', 'f', 'n', '0'):
        return False
    else:
        raise argparse.ArgumentTypeError('Boolean value expected.')

# Test cases for str2bool
ARGS = {
    'v': 'true'  # string input that should convert to boolean
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, 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
unfold Ran
ran on a synthesized input
JoegameZhou/PatchCore/src/operator.py
code served (permissive licence) · get_code("75cfa7e86dd91ed0")
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 3, dtype family float, shape (2, 27, 64) 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 numpy as np

# Create a small image tensor
# Shape: (batch_num, channel, height, width)
img = np.random.randn(2, 3, 8, 8).astype(np.float32)

ARGS = {
    "img": img,
    "kernel_size": 3,
    "stride": 1,
    "pad": 1,
    "dilation": 1
}
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 ndarray, ndim 3, dtype family float, shape (2, 27, 64) — shape (2, 27, 64) 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
dataset Not yet run
unverified (harvested, no recorded run)
amazon-research/patchcore-inspection/bin/load_and_evaluate_patchcore.py
code served (permissive licence) · get_code("1850ff44d813323e")
How it ran

no invocation recorded.

get_coreset_idx_randomp Not yet run
unverified (harvested, no recorded run)
rvorias/ind_knn_ad/indad/utils.py
code served (permissive licence) · get_code("69f7e0b8a9ede02e")
How it ran

no invocation recorded.

heatmap_on_image Not yet run
unverified (harvested, no recorded run)
tbcvContributor/DeepHawkeye/src/utils.py
code served (permissive licence) · get_code("899548de5f36cc3c")
How it ran

no invocation recorded.

load Not yet run
unverified (harvested, no recorded run)
amazon-science/patchcore-inspection/src/patchcore/backbones.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from m-3lab/real3d-ad, is pointer only (licence: NONE) · get_code("b426324b6ed6ccaf")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from m-3lab/real3d-ad, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

main_summarize Not yet run
unverified (harvested, no recorded run)
tiskw/patchcore-ad/main_mvtecad.py
code served (permissive licence) · get_code("1e3b3c661fef6c1a")
How it ran

no invocation recorded.

run_onnx Not yet run
unverified (harvested, no recorded run)
rvorias/ind_knn_ad/indad/utils.py
code served (permissive licence) · get_code("095a5a07515ea7a9")
How it ran

no invocation recorded.

trt_wide_resnet50_2 Not yet run
unverified (harvested, no recorded run)
tbcvContributor/DeepHawkeye/trt_tools/trt_wide_res_model.py
code served (permissive licence) · get_code("348384a804271606")
How it ran

no invocation recorded.

wide_resnet50_2 Not yet run
unverified (harvested, no recorded run)
tbcvContributor/DeepHawkeye/src/wide_res_model.py
code served (permissive licence) · get_code("bbc9958e58a3a24b")
How it ran

no invocation recorded.

Also present in other papers' code

Of 36 samples lifted from this paper's linked repositories, 36 carry a function identity and 0 do not. Of the 36 distinct functions with an identity, 10 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 1 the same month, 9 later) and 26 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
str2bool 175 other papers
32 dated earlier, 4 the same month, 139 later · 2 only as an assembly brick
1406.6247 (2014-06)
Recurrent Models of Visual Attention
1603.09382 (2016-03)
Deep Networks with Stochastic Depth
1710.10196 (2017-10)
Progressive Growing of GANs for Improved Quality, Stability, and Variation
and 172 more not named here
conv1x1 112 other papers
10 dated earlier, 102 later · 6 only as an assembly brick
1512.03385 (2015-12)
Deep Residual Learning for Image Recognition
1806.01531 (2018-06)
Deep Mixture of Experts via Shallow Embedding
1905.12794 (2019-05)
Fashion IQ: A New Dataset Towards Retrieving Images by Natural Language Feedback
and 109 more not named here
conv3x3 111 other papers
9 dated earlier, 102 later · 6 only as an assembly brick
1512.03385 (2015-12)
Deep Residual Learning for Image Recognition
1806.01531 (2018-06)
Deep Mixture of Experts via Shallow Embedding
1905.12794 (2019-05)
Fashion IQ: A New Dataset Towards Retrieving Images by Natural Language Feedback
and 108 more not named here
rescale 3 other papers
2 dated earlier, 1 later
2008.05369 (2020-08)
Anomaly localization by modeling perceptual features
2104.09946 (2021-04)
A cappella: Audio-visual Singing Voice Separation
2107.12571 (2021-07)
CFLOW-AD: Real-Time Unsupervised Anomaly Detection with Localization via Conditional Normalizing Flows
compute_pixelwise_retrieval_metrics 2 other papers
2 later
2303.15140 (2023-03)
SimpleNet: A Simple Network for Image Anomaly Detection and Localization
2608.15277 (2026-08)
Memory-Bounded Continuation of Greedy Sampling for Continual Anomaly Detection
load 2 other papers
2 later
2309.13226 (2023-09)
Real3D-AD: A Dataset of Point Cloud Anomaly Detection
2407.09359 (2024-07)
A Unified Anomaly Synthesis Strategy with Gradient Ascent for Industrial Anomaly Detection and Localization
compute_imagewise_retrieval_metrics 1 other paper
1 later
2608.15277 (2026-08)
Memory-Bounded Continuation of Greedy Sampling for Continual Anomaly Detection
heatmap_on_image 1 other paper
1 later
2205.00908 (2022-05)
MemSeg: A semi-supervised method for image surface defect detection using differences and commonalities
overlay_heatmap_on_image 1 other paper
1 dated earlier
2005.02357 (2020-05)
Sub-Image Anomaly Detection with Deep Pyramid Correspondences
set_torch_device 1 other paper
1 later
2407.09359 (2024-07)
A Unified Anomaly Synthesis Strategy with Gradient Ascent for Industrial Anomaly Detection and Localization

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

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

Abstract

Being able to spot defective parts is a critical component in large-scale industrial manufacturing. A particular challenge that we address in this work is the cold-start problem: fit a model using nominal (non-defective) example images only. While handcrafted solutions per class are possible, the goal is to build systems that work well simultaneously on many different tasks automatically. The best performing approaches combine embeddings from ImageNet models with an outlier detection model. In this paper, we extend on this line of work and propose \textbf{PatchCore}, which uses a maximally representative memory bank of nominal patch-features. PatchCore offers competitive inference times while achieving state-of-the-art performance for both detection and localization. On the challenging, widely used MVTec AD benchmark PatchCore achieves an image-level anomaly detection AUROC score of up to $99.6\%$, more than halving the error compared to the next best competitor. We further report competitive results on two additional datasets and also find competitive results in the few samples regime.\freefootnote{$^*$ Work done during a research internship at Amazon AWS.} Code: github.com/amazon-research/patchcore-inspection.

For agents

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

get_harvested_code_for_paper("2106.08265")
get_code_for_paper("2106.08265")
have("2106.08265")

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

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

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

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

Connect an agent — have() is free.