code stringclasses 18
values | apis sequence | extract_api stringclasses 18
values |
|---|---|---|
"""Normality model of DFKDE."""
# Copyright (C) 2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | [
"anomalib.models.components.PCA"
] | [((1718, 1744), 'torch.mean', 'torch.mean', (['dataset'], {'dim': '(1)'}), '(dataset, dim=1)\n', (1728, 1744), False, 'import torch\n'), ((1875, 1927), 'torch.linalg.svd', 'torch.linalg.svd', (['data_centered'], {'full_matrices': '(False)'}), '(data_centered, full_matrices=False)\n', (1891, 1927), False, 'import torch\... |
from typing import Union
import pytorch_lightning as pl
import torch.nn.functional as F
from omegaconf import DictConfig, ListConfig
from torch import nn, optim
from torch.utils.data import DataLoader
from torchvision import transforms
from torchvision.datasets import FakeData
from anomalib.utils.callbacks.visualizer... | [
"anomalib.utils.metrics.AdaptiveThreshold",
"anomalib.utils.callbacks.visualizer_callback.VisualizerCallback",
"anomalib.utils.metrics.MinMax",
"anomalib.utils.metrics.AnomalyScoreDistribution"
] | [((1647, 1666), 'torch.nn.Conv2d', 'nn.Conv2d', (['(3)', '(32)', '(3)'], {}), '(3, 32, 3)\n', (1656, 1666), False, 'from torch import nn, optim\n'), ((1688, 1708), 'torch.nn.Conv2d', 'nn.Conv2d', (['(32)', '(32)', '(5)'], {}), '(32, 32, 5)\n', (1697, 1708), False, 'from torch import nn, optim\n'), ((1730, 1749), 'torch... |
"""MVTec Dataset.
MVTec This script contains PyTorch Dataset, Dataloader and PyTorch
Lightning DataModule for the MVTec dataset.
If the dataset is not on the file system, the script downloads and
extracts the dataset and create PyTorch data objects.
"""
# Copyright (C) 2020 Intel Corporation
#
# Licensed under the A... | [
"anomalib.data.utils.read_image",
"anomalib.utils.download_progress_bar.DownloadProgressBar",
"anomalib.data.transforms.PreProcessor"
] | [((1516, 1556), 'logging.getLogger', 'logging.getLogger', ([], {'name': '"""Dataset: MVTec"""'}), "(name='Dataset: MVTec')\n", (1533, 1556), False, 'import logging\n'), ((2871, 2950), 'random.sample', 'random.sample', ([], {'population': 'normal_train_image_indices', 'k': 'num_normal_valid_images'}), '(population=norma... |
"""PyTorch model for CFlow model implementation."""
# Copyright (C) 2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | [
"anomalib.models.cflow.utils.get_logp",
"anomalib.models.cflow.utils.cflow_head",
"anomalib.models.cflow.utils.positional_encoding_2d"
] | [((2761, 2776), 'torch.no_grad', 'torch.no_grad', ([], {}), '()\n', (2774, 2776), False, 'import torch\n'), ((3756, 3810), 'einops.rearrange', 'einops.rearrange', (['pos_encoding', '"""b c h w -> (b h w) c"""'], {}), "(pos_encoding, 'b c h w -> (b h w) c')\n", (3772, 3810), False, 'import einops\n'), ((3838, 3899), 'ei... |
"""Custom Folder Dataset.
This script creates a custom dataset from a folder.
"""
# Copyright (C) 2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apach... | [
"anomalib.data.utils.read_image",
"anomalib.data.utils.split.create_validation_set_from_test_set",
"anomalib.pre_processing.PreProcessor",
"anomalib.data.inference.InferenceDataset",
"anomalib.data.utils.split.split_normal_images_in_train_set"
] | [((1406, 1455), 'logging.getLogger', 'logging.getLogger', ([], {'name': '"""Dataset: Folder Dataset"""'}), "(name='Dataset: Folder Dataset')\n", (1423, 1455), False, 'import logging\n'), ((4253, 4306), 'pandas.core.frame.DataFrame', 'DataFrame', (["{'image_path': filenames, 'label': labels}"], {}), "({'image_path': fil... |
"""Base Inferencer for Torch and OpenVINO."""
# Copyright (C) 2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | [
"anomalib.data.utils.read_image",
"anomalib.post_processing.normalization.cdf.standardize",
"anomalib.post_processing.normalization.cdf.normalize",
"anomalib.post_processing.normalization.min_max.normalize",
"anomalib.post_processing.compute_mask",
"anomalib.post_processing.superimpose_anomaly_map"
] | [((4618, 4648), 'anomalib.post_processing.compute_mask', 'compute_mask', (['anomaly_map', '(0.5)'], {}), '(anomaly_map, 0.5)\n', (4630, 4648), False, 'from anomalib.post_processing import compute_mask, superimpose_anomaly_map\n'), ((4809, 4859), 'cv2.resize', 'cv2.resize', (['pred_mask', '(image_width, image_height)'],... |
from pytorch_lightning import Trainer, seed_everything
from anomalib.config import get_configurable_parameters
from anomalib.data import get_datamodule
from anomalib.models import get_model
from anomalib.utils.callbacks import get_callbacks
from tests.helpers.dataset import TestDataset, get_dataset_path
def run_trai... | [
"anomalib.models.get_model",
"anomalib.data.get_datamodule",
"anomalib.config.get_configurable_parameters",
"anomalib.utils.callbacks.get_callbacks"
] | [((348, 365), 'anomalib.models.get_model', 'get_model', (['config'], {}), '(config)\n', (357, 365), False, 'from anomalib.models import get_model\n'), ((383, 405), 'anomalib.data.get_datamodule', 'get_datamodule', (['config'], {}), '(config)\n', (397, 405), False, 'from anomalib.data import get_datamodule\n'), ((422, 4... |
"""Base Inferencer for Torch and OpenVINO."""
# Copyright (C) 2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | [
"anomalib.utils.post_process.superimpose_anomaly_map",
"anomalib.data.utils.read_image",
"anomalib.utils.normalization.min_max.normalize",
"anomalib.utils.normalization.cdf.standardize",
"anomalib.utils.normalization.cdf.normalize"
] | [((3000, 3017), 'anomalib.data.utils.read_image', 'read_image', (['image'], {}), '(image)\n', (3010, 3017), False, 'from anomalib.data.utils import read_image\n'), ((3318, 3361), 'anomalib.utils.post_process.superimpose_anomaly_map', 'superimpose_anomaly_map', (['anomaly_map', 'image'], {}), '(anomaly_map, image)\n', (... |
"""Anomaly Score Normalization Callback."""
from typing import Any, Dict, Optional
import pytorch_lightning as pl
from pytorch_lightning import Callback, Trainer
from pytorch_lightning.utilities.types import STEP_OUTPUT
from torch.distributions import LogNormal
from anomalib.models import get_model
from anomalib.util... | [
"anomalib.utils.normalization.cdf.normalize",
"anomalib.models.get_model",
"anomalib.utils.normalization.cdf.standardize"
] | [((3921, 3949), 'anomalib.models.get_model', 'get_model', (['pl_module.hparams'], {}), '(pl_module.hparams)\n', (3930, 3949), False, 'from anomalib.models import get_model\n'), ((4236, 4306), 'anomalib.utils.normalization.cdf.standardize', 'standardize', (["outputs['pred_scores']", 'stats.image_mean', 'stats.image_std'... |
"""Inference Dataset."""
# Copyright (C) 2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [
"anomalib.data.utils.get_image_filenames",
"anomalib.data.utils.read_image",
"anomalib.pre_processing.PreProcessor"
] | [((1899, 1924), 'anomalib.data.utils.get_image_filenames', 'get_image_filenames', (['path'], {}), '(path)\n', (1918, 1924), False, 'from anomalib.data.utils import get_image_filenames, read_image\n'), ((2385, 2416), 'anomalib.data.utils.read_image', 'read_image', ([], {'path': 'image_filename'}), '(path=image_filename)... |
"""Common helpers for both nightly and pre-merge model tests."""
# Copyright (C) 2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LIC... | [
"anomalib.data.get_datamodule",
"anomalib.config.update_nncf_config",
"anomalib.models.get_model",
"anomalib.config.get_configurable_parameters",
"anomalib.utils.callbacks.get_callbacks"
] | [((2457, 2507), 'anomalib.config.get_configurable_parameters', 'get_configurable_parameters', ([], {'model_name': 'model_name'}), '(model_name=model_name)\n', (2484, 2507), False, 'from anomalib.config import get_configurable_parameters, update_nncf_config\n'), ((3300, 3322), 'anomalib.data.get_datamodule', 'get_datamo... |
"""BTech Dataset.
This script contains PyTorch Lightning DataModule for the BTech dataset.
If the dataset is not on the file system, the script downloads and
extracts the dataset and create PyTorch data objects.
"""
# Copyright (C) 2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "Licen... | [
"anomalib.data.inference.InferenceDataset",
"anomalib.data.utils.split.split_normal_images_in_train_set",
"anomalib.pre_processing.PreProcessor",
"anomalib.data.utils.read_image",
"anomalib.data.utils.split.create_validation_set_from_test_set",
"anomalib.data.utils.DownloadProgressBar"
] | [((1707, 1747), 'logging.getLogger', 'logging.getLogger', ([], {'name': '"""Dataset: BTech"""'}), "(name='Dataset: BTech')\n", (1724, 1747), False, 'import logging\n'), ((3930, 4006), 'pandas.DataFrame', 'pd.DataFrame', (['samples_list'], {'columns': "['path', 'split', 'label', 'image_path']"}), "(samples_list, columns... |
"""Anomalib Gradio Script.
This script provide a gradio web interface
"""
from argparse import ArgumentParser, Namespace
from importlib import import_module
from pathlib import Path
from typing import Optional, Tuple
import gradio as gr
import gradio.inputs
import gradio.outputs
import numpy as np
from skimage.segme... | [
"anomalib.post_processing.compute_mask",
"anomalib.config.get_configurable_parameters",
"anomalib.post_processing.superimpose_anomaly_map"
] | [((1312, 1355), 'anomalib.post_processing.superimpose_anomaly_map', 'superimpose_anomaly_map', (['anomaly_map', 'image'], {}), '(anomaly_map, image)\n', (1335, 1355), False, 'from anomalib.post_processing import compute_mask, superimpose_anomaly_map\n'), ((1372, 1408), 'anomalib.post_processing.compute_mask', 'compute_... |
"""CFLOW: Real-Time Unsupervised Anomaly Detection via Conditional Normalizing Flows.
https://arxiv.org/pdf/2107.12571v1.pdf
"""
# Copyright (C) 2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obta... | [
"anomalib.models.cflow.utils.positional_encoding_2d",
"anomalib.models.cflow.torch_model.CflowModel",
"anomalib.models.cflow.utils.get_logp"
] | [((1203, 1230), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (1220, 1230), False, 'import logging\n'), ((1833, 2086), 'anomalib.models.cflow.torch_model.CflowModel', 'CflowModel', ([], {'input_size': 'input_size', 'backbone': 'backbone', 'layers': 'layers', 'fiber_batch_size': 'fiber_ba... |
"""Test Config Getter."""
# Copyright (C) 2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
"anomalib.config.get_configurable_parameters"
] | [((943, 982), 'anomalib.config.get_configurable_parameters', 'get_configurable_parameters', (['model_name'], {}), '(model_name)\n', (970, 982), False, 'from anomalib.config import get_configurable_parameters\n'), ((1214, 1239), 'pytest.raises', 'pytest.raises', (['ValueError'], {}), '(ValueError)\n', (1227, 1239), Fals... |
"""Anomalib Inferencer Script.
This script performs inference by reading a model config file from
command line, and show the visualization results.
"""
# Copyright (C) 2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the L... | [
"anomalib.config.get_configurable_parameters"
] | [((1127, 1143), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (1141, 1143), False, 'from argparse import ArgumentParser, Namespace\n'), ((2247, 2311), 'cv2.getTextSize', 'cv2.getTextSize', (['text', 'font', 'font_size'], {'thickness': '(font_size // 2)'}), '(text, font, font_size, thickness=font_size /... |
"""Anomaly Classification Task."""
# Copyright (C) 2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | [
"anomalib.utils.callbacks.MinMaxNormalizationCallback"
] | [((1164, 1184), 'ote_anomalib.logging.get_logger', 'get_logger', (['__name__'], {}), '(__name__)\n', (1174, 1184), False, 'from ote_anomalib.logging import get_logger\n'), ((1867, 1945), 'ote_anomalib.data.OTEAnomalyDataModule', 'OTEAnomalyDataModule', ([], {'config': 'config', 'dataset': 'dataset', 'task_type': 'self.... |
"""Test This script performs inference on the test dataset and saves the output visualizations into a directory."""
# Copyright (C) 2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of th... | [
"anomalib.config.get_configurable_parameters",
"anomalib.utils.callbacks.get_callbacks",
"anomalib.data.get_datamodule",
"anomalib.models.get_model"
] | [((1098, 1114), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (1112, 1114), False, 'from argparse import ArgumentParser, Namespace\n'), ((1773, 1924), 'anomalib.config.get_configurable_parameters', 'get_configurable_parameters', ([], {'model_name': 'args.model', 'model_config_path': 'args.model_config_... |
README.md exists but content is empty.
- Downloads last month
- 6