SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.18961 · ICLR · 2024

AnomalyCLIP: Object-agnostic Prompt Learning for Zero-shot Anomaly Detection

Yu Tian, Guansong Pang, Qihang Zhou, Shibo He, Jiming Chen

arXiv · PDF · Open in the Atlas

Code that ran

19 of 32 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; 3 honoured the contract we drafted, 1 violated it and 3 have no contract verdict; 12 failures of our instrument; 13 no recorded run), measured 2026-11-24; 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/2310.18961.json · badge: /api/ran/2310.18961.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
zqhang/AnomalyCLIP canonical (classifier label)
classifier basis: census
12 ran · 4 no recorded run
zqhang/WinCLIP-pytorch community (classifier label)
classifier basis not recorded on the link
7 ran · 7 no recorded run
zqhang/anomalyclip community
Papers with Code archive
0 ran · 2 no recorded run
FunctionStatusWhere it lives
apply_ad_scoremap Ran
ran on a synthesized input
zqhang/WinCLIP-pytorch/reproduce_WinCLIP.py
code served (permissive licence) · get_code("f09367dd0e4c9c94")
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 (64, 64, 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 (3 channels, RGB format)
image = np.random.randint(0, 256, size=(64, 64, 3), dtype=np.uint8)

# Create a scoremap with values between 0 and 1
# Should be grayscale (single channel) or will be treated as intensity
scoremap = np.random.rand(64, 64).astype(np.float32)

# Set alpha parameter for blending
alpha = 0.5

ARGS = {
    "image": image,
    "scoremap": scoremap,
    "alpha": alpha
}
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 (64, 64, 3) — shape (64, 64, 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
basic_clean Ran
ran; our contract draft was wrong, not the code
zqhang/AnomalyCLIP/AnomalyCLIP_lib/simple_tokenizer.py
pointer only (licence: MIT); the stored copy get_code serves, from ltpwy/MSCI, is pointer only (licence: NONE) · get_code("98f385d847636a3e")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from ltpwy/MSCI, 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.

cal_pro_score Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zqhang/AnomalyCLIP/metrics.py
pointer only (licence: MIT); the stored copy get_code serves, from zqhang/PointAD, is pointer only (licence: NONE) · get_code("178a0488f0c59db0")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from zqhang/PointAD, 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.

cal_pro_score Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zqhang/WinCLIP-pytorch/reproduce_WinCLIP.py
code served (permissive licence) · get_code("e6a423edd53e011c")
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. 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 seed for reproducibility
np.random.seed(0)

# Create small dummy data for masks and amaps
# masks: binary masks indicating anomaly regions
# Shape: (batch_size, height, width) - using (2, 4, 5) for distinct dimensions
masks = np.random.randint(0, 2, size=(2, 4, 5)).astype(bool)

# amaps: anomaly maps (heatmaps with continuous values)
# Shape: (batch_size, height, width) - same spatial dims as masks
amaps = np.random.rand(2, 4, 5) * 100  # Values in range [0, 100]

# Define the arguments dictionary
ARGS = {
    "masks": masks,
    "amaps": amaps,
    "max_step": 200,
    "expect_fpr": 0.3,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, skimage, sklearn — 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
convert_to_custom_text_state_dict Ran
ran, violated the contract we drafted
zqhang/WinCLIP-pytorch/src/open_clip/model.py
pointer only (licence: MIT); the stored copy get_code serves, from deep-real/dcp, is pointer only (licence: NONE) · get_code("f19962ebb134b3d7")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from deep-real/dcp, 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.

generate_class_info Ran
ran; our contract draft was wrong, not the code
zqhang/AnomalyCLIP/dataset.py
code served (permissive licence) · get_code("bbbfccbf329e9fdd")
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

# The function generate_class_info only takes a dataset_name parameter
# and doesn't actually use the parameter value to do anything complex -
# it just maps it to different object lists and returns them.
# Let's test with one of the valid dataset names.

ARGS = {
    'dataset_name': 'mvtec'
}
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 — 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
get_cast_dtype Ran
ran; our contract draft was wrong, not the code
zqhang/WinCLIP-pytorch/src/open_clip/model.py
code served (permissive licence) · get_code("dcd422d66b0581d8")
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 dtype. 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 = {
    "precision": "bf16"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dtype — a dtype output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dtype 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
get_logger Ran
ran; our contract draft was wrong, not the code
zqhang/AnomalyCLIP/logger.py
pointer only (licence: MIT); the stored copy get_code serves, from zqhang/PointAD, is pointer only (licence: NONE) · get_code("01e8c2f30dcaa3d3")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from zqhang/PointAD, 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.

get_pairs Ran
ran; our contract draft was wrong, not the code
zqhang/AnomalyCLIP/AnomalyCLIP_lib/simple_tokenizer.py
code served (permissive licence) · get_code("d919ae32e5e4e616")
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 set. 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 get_pairs takes a word parameter
# A word is represented as a tuple of symbols (variable-length strings)
# The function iterates through the word and creates pairs of consecutive symbols

word = ("hello", "world", "test")

ARGS = {
    "word": word
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type set — a set output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a set 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
image_level_metrics Ran
ran, honoured the contract we drafted
zqhang/AnomalyCLIP/metrics.py
code served (permissive licence) · get_code("eb13a678b5dba664")
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. 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

# Build a minimal results dictionary structure
# The function accesses results[obj]['gt_sp'] and results[obj]['pr_sp']
# These should be array-like objects that can be converted to numpy arrays

results = {
    'sample_object': {
        'gt_sp': [0, 1, 0, 1, 1, 0],  # ground truth binary labels
        'pr_sp': [0.1, 0.9, 0.2, 0.8, 0.95, 0.15]  # prediction probabilities
    }
}

obj = 'sample_object'
metric = 'image-auroc'

ARGS = {
    'results': results,
    'obj': obj,
    'metric': metric
}
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 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
initialize_memory Ran
ran on a synthesized input
zqhang/WinCLIP-pytorch/few_shot.py
code served (permissive licence) · get_code("8019976ff0ac258f")
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 torch
from collections import OrderedDict

torch.manual_seed(0)

# The function iterates over obj_list and creates OrderedDicts with each element
# paired with an empty list. obj_list should be an iterable of hashable objects.
# We'll use simple strings as the objects.

obj_list = ["object_0", "object_1", "object_2"]

ARGS = {
    "obj_list": obj_list
}
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 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
load_state_dict Ran
ran; our contract draft was wrong, not the code
zqhang/AnomalyCLIP/AnomalyCLIP_lib/model_load.py
pointer only (licence: MIT); the stored copy get_code serves, from zqhang/PointAD, is pointer only (licence: NONE) · get_code("4b3a4d17e1df3140")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from zqhang/PointAD, 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.

normalize Ran
ran, honoured the contract we drafted
zqhang/AnomalyCLIP/utils.py
code served (permissive licence) · get_code("0c3f9d9b0ac9f33d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) 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

torch.manual_seed(0)

pred = torch.randn(2, 4)
max_value = 1.5
min_value = -1.0

ARGS = {
    'pred': pred,
    'max_value': max_value,
    'min_value': min_value
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
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 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
pixel_level_metrics Ran
ran, honoured the contract we drafted
zqhang/AnomalyCLIP/metrics.py
code served (permissive licence) · get_code("cc90ad1a3ffd0e88")
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. 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 sample data for testing
np.random.seed(0)

# Create ground truth masks (4D: batch_size, 1, height, width)
# or (3D: batch_size, height, width)
batch_size = 2
height = 8
width = 8

# Ground truth masks - binary masks with some anomalies
gt_masks_3d = np.random.randint(0, 2, size=(batch_size, height, width))

# Anomaly maps - continuous values between 0 and 1
anomaly_maps_3d = np.random.rand(batch_size, height, width)

# Create results dictionary structure
results = {
    'test_object': {
        'imgs_masks': [gt_masks_3d[0], gt_masks_3d[1]],  # list of 2D arrays
        'anomaly_maps': [anomaly_maps_3d[0], anomaly_maps_3d[1]]  # list of 2D arrays
    }
}

ARGS = {
    'results': results,
    'obj': 'test_object',
    'metric': 'pixel-auroc'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, skimage, sklearn — 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
prepare_inputs_for_generation Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zqhang/WinCLIP-pytorch/src/open_clip/coca_model.py
pointer only (licence: MIT); the stored copy get_code serves, from WHU-USI3DV/TreeCLS, is pointer only (licence: NONE) · get_code("fb651d0a97fd4d3f")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from WHU-USI3DV/TreeCLS, 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.

register_pooler Ran
ran on a synthesized input
zqhang/WinCLIP-pytorch/src/open_clip/hf_model.py
pointer only (licence: MIT); the stored copy get_code serves, from WHU-USI3DV/TreeCLS, is pointer only (licence: NONE) · get_code("2a377da4a76a2d44")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from WHU-USI3DV/TreeCLS, 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.

smooth Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zqhang/AnomalyCLIP/loss.py
code served (permissive licence) · get_code("abedbe9b904a9780")
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 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 torch

torch.manual_seed(0)

# The function expects:
# - arr: a tensor that supports indexing with [:, :, :] (3D tensor)
# - lamda1: a scalar (float or int) for weighting the loss

# Create a small 3D tensor: (batch=2, height=4, width=3)
arr = torch.randn(2, 4, 3)

# Create a scalar lambda parameter
lamda1 = 0.5

ARGS = {
    "arr": arr,
    "lamda1": lamda1,
}
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 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
sparsity Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zqhang/AnomalyCLIP/loss.py
pointer only (licence: MIT); the stored copy get_code serves, from zqhang/PointAD, is pointer only (licence: NONE) · get_code("208456d9417303f4")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from zqhang/PointAD, 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.

whitespace_clean Ran
ran; our contract draft was wrong, not the code
zqhang/AnomalyCLIP/AnomalyCLIP_lib/simple_tokenizer.py
pointer only (licence: MIT); the stored copy get_code serves, from ltpwy/MSCI, is pointer only (licence: NONE) · get_code("9542161e9640b858")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from ltpwy/MSCI, 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.

AnomalyCLIP Not yet run
unverified (harvested, no recorded run)
zqhang/anomalyclip/AnomalyCLIP_lib/AnomalyCLIP.py
code served (permissive licence) · get_code("f8d43518b10ab859")
How it ran

no invocation recorded.

VisionTransformer Not yet run
unverified (harvested, no recorded run)
zqhang/anomalyclip/AnomalyCLIP_lib/AnomalyCLIP.py
code served (permissive licence) · get_code("175f83b44a42759d")
How it ran

no invocation recorded.

build_model Not yet run
unverified (harvested, no recorded run)
zqhang/AnomalyCLIP/AnomalyCLIP_lib/build_model.py
pointer only (licence: MIT); the stored copy get_code serves, from zqhang/PointAD, is pointer only (licence: NONE) · get_code("ed57101d91ad0e4e")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from zqhang/PointAD, 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.

build_model_from_openai_state_dict Not yet run
unverified (harvested, no recorded run)
zqhang/WinCLIP-pytorch/src/open_clip/model.py
code served (permissive licence) · get_code("e332828701fffe70")
How it ran

no invocation recorded.

build_model_from_openai_state_dict Not yet run
unverified (harvested, no recorded run)
zqhang/WinCLIP-pytorch/src/open_clip/model_revise.py
code served (permissive licence) · get_code("e0b318791c717866")
How it ran

no invocation recorded.

gather_features Not yet run
unverified (harvested, no recorded run)
zqhang/WinCLIP-pytorch/src/open_clip/loss.py
pointer only (licence: MIT); the stored copy get_code serves, from lxa9867/imagefolder, is pointer only (licence: NOASSERTION) · get_code("ddcbd45e940484ee")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from lxa9867/imagefolder, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

get_model_config Not yet run
unverified (harvested, no recorded run)
zqhang/WinCLIP-pytorch/src/open_clip/factory.py
code served (permissive licence) · get_code("5c7cf820e99443ff")
How it ran

no invocation recorded.

get_tokenizer Not yet run
unverified (harvested, no recorded run)
zqhang/WinCLIP-pytorch/src/open_clip/factory.py
pointer only (licence: MIT); the stored copy get_code serves, from sarahesl/alignclip, is pointer only (licence: NONE) · get_code("f34d8f34635af394")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from sarahesl/alignclip, 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.

image_transform Not yet run
unverified (harvested, no recorded run)
zqhang/AnomalyCLIP/AnomalyCLIP_lib/transform.py
pointer only (licence: MIT); the stored copy get_code serves, from zqhang/PointAD, is pointer only (licence: NONE) · get_code("2c38b8a1a6553df1")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from zqhang/PointAD, 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.

load Not yet run
unverified (harvested, no recorded run)
zqhang/AnomalyCLIP/AnomalyCLIP_lib/model_load.py
pointer only (licence: MIT); the stored copy get_code serves, from zqhang/PointAD, is pointer only (licence: NONE) · get_code("45e1ef91f571e2f5")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from zqhang/PointAD, 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.

load_checkpoint Not yet run
unverified (harvested, no recorded run)
zqhang/AnomalyCLIP/AnomalyCLIP_lib/model_load.py
pointer only (licence: MIT); the stored copy get_code serves, from zqhang/PointAD, is pointer only (licence: NONE) · get_code("d53108edea9d2b46")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from zqhang/PointAD, 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.

load_openai_model Not yet run
unverified (harvested, no recorded run)
zqhang/WinCLIP-pytorch/src/open_clip/openai.py
code served (permissive licence) · get_code("a1693b09a14a516f")
How it ran

no invocation recorded.

memory Not yet run
unverified (harvested, no recorded run)
zqhang/WinCLIP-pytorch/few_shot.py
code served (permissive licence) · get_code("db75b22fe2d18129")
How it ran

no invocation recorded.

Also present in other papers' code

Of 32 samples lifted from this paper's linked repositories, 32 carry a function identity and 0 do not. Of the 30 distinct functions with an identity, 23 are also present in other papers whose code we hold (15 with at least one paper dated earlier, 9 the same month, 23 later) and 7 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
get_pairs 258 other papers
79 dated earlier, 2 the same month, 169 later, 7 same year, order not determinable, 1 undated · 4 only as an assembly brick
1802.06474 (2018-02)
A Closed-form Solution to Photorealistic Image Stylization
1803.01128 (2018-03)
Seq2Sick: Evaluating the Robustness of Sequence-to-Sequence Models with Adversarial Examples
1809.00125 (2018-09)
Simple Fusion: Return of the Language Model
and 255 more not named here
whitespace_clean 231 other papers
63 dated earlier, 2 the same month, 160 later, 5 same year, order not determinable, 1 undated · 4 only as an assembly brick
1901.07441 (2019-01)
PadChest: A large chest x-ray image dataset with multi-label annotated reports
2107.06383 (2021-07)
How Much Can CLIP Benefit Vision-and-Language Tasks?
2108.10904 (2021-08)
SimVLM: Simple Visual Language Model Pretraining with Weak Supervision
and 228 more not named here
basic_clean 218 other papers
63 dated earlier, 2 the same month, 147 later, 5 same year, order not determinable, 1 undated · 4 only as an assembly brick
1901.07441 (2019-01)
PadChest: A large chest x-ray image dataset with multi-label annotated reports
2107.06383 (2021-07)
How Much Can CLIP Benefit Vision-and-Language Tasks?
2108.10904 (2021-08)
SimVLM: Simple Visual Language Model Pretraining with Weak Supervision
and 215 more not named here
get_cast_dtype 66 other papers
12 dated earlier, 1 the same month, 53 later
2103.00020 (2021-03)
Learning Transferable Visual Models From Natural Language Supervision
2210.08402 (2022-10)
LAION-5B: An open large-scale dataset for training next generation image-text models
2212.07143 (2022-12)
Reproducible scaling laws for contrastive language-image learning
and 63 more not named here
gather_features 57 other papers
12 dated earlier, 45 later · 1 only as an assembly brick
2206.01670 (2022-06)
Egocentric Video-Language Pretraining
2212.00638 (2022-12)
Finetune like you pretrain: Improved finetuning of zero-shot vision models
2301.07094 (2023-01)
Learning Customized Visual Models with Retrieval-Augmented Knowledge
and 54 more not named here
convert_to_custom_text_state_dict 49 other papers
11 dated earlier, 38 later
2103.00020 (2021-03)
Learning Transferable Visual Models From Natural Language Supervision
2210.08402 (2022-10)
LAION-5B: An open large-scale dataset for training next generation image-text models
2212.07143 (2022-12)
Reproducible scaling laws for contrastive language-image learning
and 46 more not named here
register_pooler 45 other papers
8 dated earlier, 1 the same month, 36 later
2301.07094 (2023-01)
Learning Customized Visual Models with Retrieval-Augmented Knowledge
2302.03668 (2023-02)
Hard Prompts Made Easy: Gradient-Based Discrete Optimization for Prompt Tuning and Discovery
2303.14814 (2023-03)
WinCLIP: Zero-/Few-Shot Anomaly Classification and Segmentation
and 42 more not named here
prepare_inputs_for_generation 43 other papers
6 dated earlier, 1 the same month, 36 later
2301.07094 (2023-01)
Learning Customized Visual Models with Retrieval-Augmented Knowledge
2303.14814 (2023-03)
WinCLIP: Zero-/Few-Shot Anomaly Classification and Segmentation
2305.07017 (2023-05)
An Inverse Scaling Law for CLIP Training
and 40 more not named here
build_model_from_openai_state_dict 30 other papers
8 dated earlier, 1 the same month, 21 later
2301.07094 (2023-01)
Learning Customized Visual Models with Retrieval-Augmented Knowledge
2302.03668 (2023-02)
Hard Prompts Made Easy: Gradient-Based Discrete Optimization for Prompt Tuning and Discovery
2303.14814 (2023-03)
WinCLIP: Zero-/Few-Shot Anomaly Classification and Segmentation
and 27 more not named here
get_model_config 22 other papers
5 dated earlier, 1 the same month, 16 later
2211.07636 (2022-11)
EVA: Exploring the Limits of Masked Visual Representation Learning at Scale
2301.07094 (2023-01)
Learning Customized Visual Models with Retrieval-Augmented Knowledge
2303.14814 (2023-03)
WinCLIP: Zero-/Few-Shot Anomaly Classification and Segmentation
and 19 more not named here
load_state_dict 18 other papers
5 dated earlier, 1 the same month, 12 later
2301.07094 (2023-01)
Learning Customized Visual Models with Retrieval-Augmented Knowledge
2303.07240 (2023-03)
PMC-CLIP: Contrastive Language-Image Pre-training using Biomedical Documents
2303.14814 (2023-03)
WinCLIP: Zero-/Few-Shot Anomaly Classification and Segmentation
and 15 more not named here
get_tokenizer 8 other papers
3 dated earlier, 5 later
2301.07094 (2023-01)
Learning Customized Visual Models with Retrieval-Augmented Knowledge
2303.14814 (2023-03)
WinCLIP: Zero-/Few-Shot Anomaly Classification and Segmentation
2305.17382 (2023-05)
APRIL-GAN: A Zero-/Few-Shot Anomaly Classification and Segmentation Method for CVPR 2023 VAND Workshop Challenge Tracks 1&2: 1st Place on Zero-shot AD and 4th Place on Few-shot AD
and 5 more not named here
load_openai_model 4 other papers
2 dated earlier, 2 later
2301.07094 (2023-01)
Learning Customized Visual Models with Retrieval-Augmented Knowledge
2307.12732 (2023-07)
CLIP-KD: An Empirical Study of CLIP Model Distillation
2404.05231 (2024-04)
PromptAD: Learning Prompts with only Normal Samples for Few-Shot Anomaly Detection
and 1 more not named here
smooth 4 other papers
1 dated earlier, 3 later · 1 only as an assembly brick
2306.10485 (2023-06)
Balanced Energy Regularization Loss for Out-of-distribution Detection
2404.13671 (2024-04)
FiLo: Zero-Shot Anomaly Detection by Fine-Grained Description and High-Quality Localization
2410.00320 (2024-10)
PointAD: Comprehending 3D Anomalies from Points and Pixels for Zero-shot 3D Anomaly Detection
and 1 more not named here
normalize 3 other papers
1 dated earlier, 2 later
2303.14814 (2023-03)
WinCLIP: Zero-/Few-Shot Anomaly Classification and Segmentation
2410.00320 (2024-10)
PointAD: Comprehending 3D Anomalies from Points and Pixels for Zero-shot 3D Anomaly Detection
2505.09265 (2025-05)
MetaUAS: Universal Anomaly Segmentation with One-Prompt Meta-Learning
image_transform 2 other papers
2 later
2406.17639 (2024-06)
Mitigate the Gap: Investigating Approaches for Improving Cross-Modal Alignment in CLIP
2410.00320 (2024-10)
PointAD: Comprehending 3D Anomalies from Points and Pixels for Zero-shot 3D Anomaly Detection
load_checkpoint 2 other papers
2 later
2403.12570 (2024-03)
Adapting Visual-Language Models for Generalizable Anomaly Detection in Medical Images
2410.00320 (2024-10)
PointAD: Comprehending 3D Anomalies from Points and Pixels for Zero-shot 3D Anomaly Detection
sparsity 2 other papers
2 later
2404.13671 (2024-04)
FiLo: Zero-Shot Anomaly Detection by Fine-Grained Description and High-Quality Localization
2410.00320 (2024-10)
PointAD: Comprehending 3D Anomalies from Points and Pixels for Zero-shot 3D Anomaly Detection
AnomalyCLIP
brick of this paper's assembly: entry
1 other paper
1 later
2410.00320 (2024-10)
PointAD: Comprehending 3D Anomalies from Points and Pixels for Zero-shot 3D Anomaly Detection
build_model 1 other paper
1 later
2410.00320 (2024-10)
PointAD: Comprehending 3D Anomalies from Points and Pixels for Zero-shot 3D Anomaly Detection

Shown: the 20 functions present in the most other papers. 3 more shared functions are not listed here.

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-24.

Repositories linked to this paper

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

Abstract

Zero-shot anomaly detection (ZSAD) requires detection models trained using auxiliary data to detect anomalies without any training sample in a target dataset. It is a crucial task when training data is not accessible due to various concerns, e.g., data privacy, yet it is challenging since the models need to generalize to anomalies across different domains where the appearance of foreground objects, abnormal regions, and background features, such as defects/tumors on different products/organs, can vary significantly. Recently large pre-trained vision-language models (VLMs), such as CLIP, have demonstrated strong zero-shot recognition ability in various vision tasks, including anomaly detection. However, their ZSAD performance is weak since the VLMs focus more on modeling the class semantics of the foreground objects rather than the abnormality/normality in the images. In this paper we introduce a novel approach, namely AnomalyCLIP, to adapt CLIP for accurate ZSAD across different domains. The key insight of Anoma-lyCLIP is to learn object-agnostic text prompts that capture generic normality and abnormality in an image regardless of its foreground objects. This allows our model to focus on the abnormal image regions rather than the object semantics, enabling generalized normality and abnormality recognition on diverse types of objects. Large-scale experiments on 17 real-world anomaly detection datasets show that AnomalyCLIP achieves superior zero-shot performance of detecting and segmenting anomalies in datasets of highly diverse class semantics from various defect inspection and medical imaging domains. Code will be made available at https://github.com/zqhang/AnomalyCLIP.

For agents

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

get_harvested_code_for_paper("2310.18961")
get_code_for_paper("2310.18961")
have("2310.18961")

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

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

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

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

Connect an agent — have() is free.