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
Release history Release notifications | RSS feed
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.1.tar.gz
(3.7 kB
view details)
Built Distribution
File details
Details for the file torchvision4ad-0.1.1.tar.gz
.
File metadata
- Download URL: torchvision4ad-0.1.1.tar.gz
- Upload date:
- Size: 3.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a61553b5fff6fcef1e0fd2d43228b30109e71ec2c26183dcd7b3b9d9fedf5e0 |
|
MD5 | e76bc12ebfba6f7535a29225c2968a63 |
|
BLAKE2b-256 | a91d3dcfc004708301dfbcec7afd3e8a4cb5f79857a96a1a783c534c6653c057 |
File details
Details for the file torchvision4ad-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: torchvision4ad-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.5 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfce9cdb3e8c4f3c9e22ad5df9706c5b38604226d7271205f79e29538fb60e7f |
|
MD5 | 2d61ead3a45938003772ea5335d89dcb |
|
BLAKE2b-256 | b62f7d6026a1b5f7003ed298355cfadccacdf4dba792a8b7de7f56b813258ff2 |