Skip to main content
Documentation Status https://img.shields.io/pypi/v/tfds_defect_detection PyPI - Python Version

TensorFlow Datasets for Defect Detection

To directly jump into the code look at the sample notebook

Open in Colab

Install

Create a new python=3.9 env and install tfds_defect_detection from pip

pip install tfds_defect_detection

Examples

import tfds_defect_detection as tfd
tfd.load()

Usage

All parmeters

import tfds_defect_detection as tfd
impor albumentations as A

ds = tfd.load(
    names = ("mvtec", "visa"),
    data_dir=Path("."),
    pairing_mode = "result_with_contrastive_pair",  # "result_only", "result_with_original"
    create_artificial_anomalies=True,
    validation_split=0.2,
    subset_mode = "training",                       # "validation", "test", "holdout", None
    drop_masks=False,
    width=256,
    height=256,
    repeat=True,
    anomaly_size = None,

    global_transform=A.Compose([
      A.RandomBrightnessContrast(),
      A.HueSaturationValue(),
    ]),

    process_deviation=A.Compose([
      A.ShiftScaleRotate(
        shift_limit=0.01,
        scale_limit=0.0,
        rotate_limit=1.5,
        p=1
      ),
      A.Blur(blur_limit=3),
      A.RandomBrightnessContrast(),
      A.RandomGamma(),
      A.HueSaturationValue(),
    ]),

    anomaly_composition=A.Compose([
      A.RandomRotate90(),
      A.Transpose(),
      A.ShiftScaleRotate(
        shift_limit=0.0625,
        scale_limit=0.50,
        rotate_limit=45, p=1
      ),
      A.RandomGamma(),
      A.OpticalDistortion(),
      A.GridDistortion(),
      A.RandomContrast(0.5, p=1),
    ]),

    batch_size=9,
    seed=123,
    shuffle=True,
    peek=True,
    image_validation=False,
    delete_tmp=True,
    crop_to_aspect_ratio=True
)

Release files for tfds-defect-detection 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tfds-defect-detection 1.0.0
File Size Uploaded
tfds_defect_detection-1.0.0.tar.gz 19.4 kB Details

Release files / tfds_defect_detection-1.0.0.tar.gz

Download URL tfds_defect_detection-1.0.0.tar.gz
Size 19.4 kB
Tags Source
SHA-256 checksum
How to use checksums
65a903fd2491f2e42bdb04453f6bc3ab6b099cb1a63b07ff8cdb85bc35bf7598
BLAKE2b-256 checksum
How to use checksums
70b3ef458615ff67df146bedbc07f891920727a545cd4759e3d82eabd78c540c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.7.5

Release history Release notifications | RSS feed

This release

1.0.0 This release

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page