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.0.tar.gz (2.3 kB view details)

Uploaded Source

Built Distributions

torchvision4ad-0.1.0-py3.7.egg (1.7 kB view details)

Uploaded Source

torchvision4ad-0.1.0-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: torchvision4ad-0.1.0.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.4

File hashes

Hashes for torchvision4ad-0.1.0.tar.gz
Algorithm Hash digest
SHA256 acfb5875a4a95c46677693a8ec4b20b7229b9fc7841239d7147c398b80d143dd
MD5 df560ed3773b905f12ea51dc08582a28
BLAKE2b-256 5c6995ebe534442fa10e4c86703d189121c22344bce2823bf76aa1716a576b8d

See more details on using hashes here.

File details

Details for the file torchvision4ad-0.1.0-py3.7.egg.

File metadata

  • Download URL: torchvision4ad-0.1.0-py3.7.egg
  • Upload date:
  • Size: 1.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.4

File hashes

Hashes for torchvision4ad-0.1.0-py3.7.egg
Algorithm Hash digest
SHA256 425a67da100e8a602b716950e76d4fa0c55235a4067403371499caf463bdfe23
MD5 9f97830807842a461f9bc6866b45c3d2
BLAKE2b-256 07bdad107562ca706d215152bec9030ff06657e1bd5c1ce36e727acf716572f0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: torchvision4ad-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.4

File hashes

Hashes for torchvision4ad-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 710455847c28c251593288b241333286012b1c5bba133ea109d2dfbaaff3bd5b
MD5 afdc0011df3282a1e73041499ec4fd72
BLAKE2b-256 99fad9630acb33bfd94e423f264d6da4e1b801053bc0e4c1ee244e99770535da

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