Skip to main content

torchvision for anomaly detection

Project description

torchvision for Anomaly Detection

You can use the MVTec Anomaly Detection Dataset.

Installation

pip:

$ pip install torchvision4ad

From source:

$ python setup.py install

Usage

You can use one of the MVTec AD Dataset names {'bottle', 'cable', 'capsule', 'carpet', 'grid', 'hazelnut', 'leather', 'metal_nut', 'pill', 'screw', 'tile', 'toothbrush', 'transistor', 'wood', 'zipper'}.

from torchvision4ad.datasets import MVTecAD


root = 'mvtec_ad'
dataset_name = 'bottle'
mvtec_ad = MVTecAD(root, dataset_name, train=True, download=True)
for (img, target) in mvtec_ad:
    ...

Of course, you can also give a function/transform takes in an PIL image and returns a transformed version.

import torchvision.transforms as transforms

from torchvision4ad.datasets import MVTecAD


transform = transforms.Compose([transforms.Resize([64, 64]),
                                transforms.ToTensor()])
mvtec_ad = MVTecAD('mvtec_ad', 'bottle', train=True, transform=transform, download=True)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

torchvision4ad-0.1.2.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

torchvision4ad-0.1.2-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file torchvision4ad-0.1.2.tar.gz.

File metadata

  • Download URL: torchvision4ad-0.1.2.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.7.4

File hashes

Hashes for torchvision4ad-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d92987264ff25a50a8a117963887369ad01e403304d9e13d8d5dadd4afef1c40
MD5 42efa38fb7c520db415b19390a26bc58
BLAKE2b-256 2a7699339185f0d23c92e5c85963c349c74fccef85cd582100589eecf09152cb

See more details on using hashes here.

File details

Details for the file torchvision4ad-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for torchvision4ad-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 43d6c683fcaabe83617ad7a80027f99421857a87058fb9ca5e49c6c769450e70
MD5 9f312e840f2abb2ad309801026a8f40c
BLAKE2b-256 2489017c4e168eee6a6ad2dad64ded1209fb5eb9a06fa262851ca1cee7aabab0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page