MCPcopy Create free account

hub / github.com/amazon-science/patchcore-inspection / functions

Functions132 in github.com/amazon-science/patchcore-inspection

↓ 19 callersMethodrun
Returns distances and indices of nearest neighbour search. Args: query_features: Features to retrieve. index
src/patchcore/common.py:66
↓ 9 callersMethodfit
Adds features to the FAISS search index. Args: features: Array of size NxD.
src/patchcore/common.py:50
↓ 9 callersMethodmerge
(self, features: list)
src/patchcore/common.py:124
↓ 8 callersMethodpredict
(self, data)
src/patchcore/patchcore.py:178
↓ 6 callersMethodload
( self, backbone, layers_to_extract_from, device, input_shape,
src/patchcore/patchcore.py:25
↓ 5 callersFunction_dummy_features
(feature_dimension)
test/test_sampler.py:8
↓ 4 callersMethod__init__
FAISS Nearest neighbourhood search. Args: on_gpu: If set true, nearest neighbour searches are done on GPU. num_worker
src/patchcore/common.py:15
↓ 4 callersMethod_embed
Returns feature embeddings for images.
src/patchcore/patchcore.py:91
↓ 4 callersFunction_standard_patchcore
(image_dimension)
test/test_patchcore.py:43
↓ 4 callersMethodload
(self, filename: str)
src/patchcore/common.py:91
↓ 3 callersMethod__init__
(self, percentage: float)
src/patchcore/sampler.py:17
↓ 3 callersMethod_compute_batchwise_differences
Computes batchwise Euclidean distances using PyTorch.
src/patchcore/sampler.py:81
↓ 3 callersMethod_detection_file
(folder, prepend="")
src/patchcore/common.py:353
↓ 3 callersFunction_dummy_constant_dataloader
(number_of_examples, shape_of_examples)
test/test_patchcore.py:15
↓ 3 callersMethodload_from_path
( self, load_path: str, device: torch.device, nn_method: patchcore.common.Fais
src/patchcore/patchcore.py:256
↓ 3 callersMethodsave
(self, filename: str)
src/patchcore/common.py:88
↓ 2 callersMethod_create_index
(self, dimension)
src/patchcore/common.py:43
↓ 2 callersFunction_dummy_various_dataloader
(number_of_examples, shape_of_examples)
test/test_patchcore.py:28
↓ 2 callersMethod_index_file
(folder, prepend="")
src/patchcore/common.py:357
↓ 2 callersMethod_index_to_gpu
(self, index)
src/patchcore/common.py:29
↓ 2 callersMethod_params_file
(filepath, prepend="")
src/patchcore/patchcore.py:231
↓ 2 callersMethod_predict
Infer score and mask for a batch of images.
src/patchcore/patchcore.py:203
↓ 2 callersMethod_train
(self, _index, _features)
src/patchcore/common.py:63
↓ 2 callersMethodreset_index
(self)
src/patchcore/common.py:94
↓ 2 callersMethodsave_to_path
(self, save_path: str, prepend: str = "")
src/patchcore/patchcore.py:234
↓ 2 callersMethodunpatch_scores
(self, x, batchsize)
src/patchcore/patchcore.py:310
↓ 1 callersFunction_approximate_greedycoreset_sampler_with_reduction
( sampling_percentage, johnsonlindenstrauss_dim )
test/test_patchcore.py:72
↓ 1 callersMethod_compute_greedy_coreset_indices
Runs iterative greedy coreset selection. Args: features: [NxD] input feature bank to sample.
src/patchcore/sampler.py:91
↓ 1 callersFunction_dummy_constant_features
(number_of_examples, feature_dimension)
test/test_sampler.py:17
↓ 1 callersFunction_dummy_features
(number_of_examples, shape_of_examples)
test/test_patchcore.py:9
↓ 1 callersFunction_dummy_images
(number_of_examples, image_shape)
test/test_patchcore.py:33
↓ 1 callersFunction_dummy_various_features
(number_of_examples, shape_of_examples)
test/test_patchcore.py:20
↓ 1 callersMethod_fill_memory_bank
Computes and sets the support features for SPADE.
src/patchcore/patchcore.py:155
↓ 1 callersMethod_gpu_cloner_options
(self)
src/patchcore/common.py:26
↓ 1 callersMethod_index_to_cpu
(self, index)
src/patchcore/common.py:38
↓ 1 callersMethod_load
(filename: str)
src/patchcore/common.py:368
↓ 1 callersMethod_predict_dataloader
This function provides anomaly scores/maps for full dataloaders.
src/patchcore/patchcore.py:183
↓ 1 callersMethod_reduce
(features)
src/patchcore/common.py:140
↓ 1 callersMethod_reduce_features
(self, features)
src/patchcore/sampler.py:52
↓ 1 callersMethod_restore_type
(self, features: torch.Tensor)
src/patchcore/sampler.py:33
↓ 1 callersMethod_save
(filename, features)
src/patchcore/common.py:361
↓ 1 callersMethod_store_type
(self, features: Union[torch.Tensor, np.ndarray])
src/patchcore/sampler.py:28
↓ 1 callersMethodconvert_to_segmentation
(self, patch_scores)
src/patchcore/common.py:192
↓ 1 callersMethodfeature_dimensions
Computes the feature dimensions for all layers given input_shape.
src/patchcore/common.py:270
↓ 1 callersMethodfit
PatchCore training. This function computes the embeddings of the training data and fills the memory bank of SPADE.
src/patchcore/patchcore.py:147
↓ 1 callersMethodget_image_data
(self)
src/patchcore/datasets/mvtec.py:115
↓ 1 callersFunctionimage_transform
(image)
bin/run_patchcore.py:147
↓ 1 callersFunctionmain
(**kwargs)
bin/load_and_evaluate_patchcore.py:27
↓ 1 callersFunctionmain
(**kwargs)
bin/run_patchcore.py:30
↓ 1 callersFunctionmask_transform
(mask)
bin/run_patchcore.py:159
↓ 1 callersMethodpatchify
Convert a tensor into a tensor of respective patches. Args: x: [torch.Tensor, bs x c x w x h] Returns: x: [tor
src/patchcore/patchcore.py:282
↓ 1 callersMethodrun
Subsamples features using Greedy Coreset. Args: features: [N x D]
src/patchcore/sampler.py:62
↓ 1 callersMethodrun
Randomly samples input feature collection. Args: features: [N x D]
src/patchcore/sampler.py:178
↓ 1 callersMethodsave
( self, save_folder: str, save_features_separately: bool = False, prepend: str
src/patchcore/common.py:372
↓ 1 callersMethodscore
(self, x)
src/patchcore/patchcore.py:313
Method__call__
(self, module, input, output)
src/patchcore/common.py:285
Method__getitem__
(self, idx)
src/patchcore/datasets/mvtec.py:91
Method__init__
PatchCore anomaly detection class.
src/patchcore/patchcore.py:20
Method__init__
(self, patchsize, stride=None)
src/patchcore/patchcore.py:278
Method__init__
Merges feature embedding by name.
src/patchcore/common.py:121
Method__init__
(self, input_dims, output_dim)
src/patchcore/common.py:146
Method__init__
(self, preprocessing_dim)
src/patchcore/common.py:164
Method__init__
(self, target_dim)
src/patchcore/common.py:174
Method__init__
(self, device, target_size=224)
src/patchcore/common.py:187
Method__init__
(self, backbone, layers_to_extract_from, device)
src/patchcore/common.py:214
Method__init__
(self, hook_dict, layer_name: str, last_layer_to_extract: str)
src/patchcore/common.py:278
Method__init__
Neearest-Neighbourhood Anomaly Scorer class. Args: n_nearest_neighbours: [int] Number of nearest neighbours used to
src/patchcore/common.py:297
Method__init__
Greedy Coreset sampling base class.
src/patchcore/sampler.py:40
Method__init__
Approximate Greedy Coreset sampling base class.
src/patchcore/sampler.py:119
Method__init__
(self, percentage: float)
src/patchcore/sampler.py:175
Method__init__
Args: source: [str]. Path to the MVTec data folder. classname: [str or None]. Name of MVTec class that should be
src/patchcore/datasets/mvtec.py:41
Method__len__
(self)
src/patchcore/datasets/mvtec.py:112
Method_compute_greedy_coreset_indices
Runs approximate iterative greedy coreset selection. This greedy coreset implementation does not require computation of the full N x
src/patchcore/sampler.py:130
Method_create_index
(self, dimension)
src/patchcore/common.py:109
Method_detach
(features)
src/patchcore/patchcore.py:94
Function_dummy_image_random_dataloader
(number_of_examples, image_shape)
test/test_patchcore.py:38
Method_gpu_cloner_options
(self)
src/patchcore/common.py:104
Method_image_to_features
(input_image)
src/patchcore/patchcore.py:159
Function_load_patchcore_from_path
(load_path)
test/test_patchcore.py:61
Method_reduce
(features)
src/patchcore/common.py:131
Method_train
(self, index, features)
src/patchcore/common.py:101
Functioncompute_and_store_final_results
Store computed results as CSV file. Args: results_path: [str] Where to store result csv. results: [List[List]] List of lists cont
src/patchcore/utils.py:127
Functioncompute_imagewise_retrieval_metrics
Computes retrieval statistics (AUROC, FPR, TPR). Args: anomaly_prediction_weights: [np.array or list] [N] Assignment weights
src/patchcore/metrics.py:6
Functioncompute_pixelwise_retrieval_metrics
Computes pixel-wise statistics (AUROC, FPR, TPR) for anomaly segmentations and ground truth segmentation masks. Args: anomaly_se
src/patchcore/metrics.py:28
Functioncreate_storage_folder
( main_folder_path, project_folder, group_folder, mode="iterate" )
src/patchcore/utils.py:77
Functiondataset
( name, data_path, subdatasets, batch_size, resize, imagesize, num_workers, augment )
bin/load_and_evaluate_patchcore.py:247
Functiondataset
( name, data_path, subdatasets, train_val_split, batch_size, resize, imagesize,
bin/run_patchcore.py:343
Methodembed
(self, data)
src/patchcore/patchcore.py:79
Methodfit
Calls the fit function of the nearest neighbour method. Args: detection_features: [list of np.arrays] [[bs x d_i]
src/patchcore/common.py:316
Functionfix_seeds
Fixed available seeds for reproducibility. Args: seed: [int] Seed value. with_torch: Flag. If true, torch-related seeds are fixed
src/patchcore/utils.py:109
Methodforward
(self, features)
src/patchcore/common.py:156
Methodforward
(self, features)
src/patchcore/common.py:168
Methodforward
Returns reshaped and average pooled features.
src/patchcore/common.py:178
Methodforward
(self, images)
src/patchcore/common.py:259
Functionget_dataloaders
(seed)
bin/run_patchcore.py:357
Functionget_dataloaders_iter
(seed)
bin/load_and_evaluate_patchcore.py:253
Functionget_patchcore
(input_shape, sampler, device)
bin/run_patchcore.py:284
Functionget_patchcore_iter
(device)
bin/load_and_evaluate_patchcore.py:205
Functionget_sampler
(device)
bin/run_patchcore.py:322
Functionimage_transform
(image)
bin/load_and_evaluate_patchcore.py:122
next →1–100 of 132, ranked by callers