Skip to main content

A modernized library for image corruptions based on ImageNet-C

Project description

corrupt_tta

corrupt_tta is a modernized Python library for applying image corruptions, based on the original ImageNet-C benchmark. It has been rewritten to use modern APIs (OpenCV, Scikit-Image, NumPy) and removes outdated dependencies like Wand (ImageMagick).

Installation

pip install corrupt_tta

Usage

import numpy as np
from PIL import Image
from corrupt_tta import corrupt

# Load an image
img = np.array(Image.open("example.jpg"))

# Apply a corruption (e.g., Gaussian Noise with severity 3)
corrupted_img = corrupt(img, severity=3, corruption_name="gaussian_noise")

# Save or display the result
Image.fromarray(corrupted_img.astype(np.uint8)).save("corrupted.jpg")

Available Corruptions

  • Noise: gaussian_noise, shot_noise, impulse_noise, speckle_noise
  • Blur: gaussian_blur, glass_blur, defocus_blur, motion_blur, zoom_blur
  • Weather: fog, frost, snow
  • Digital: contrast, brightness, saturate, jpeg_compression, pixelate, elastic_transform

License

MIT

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

corrupt_tta-0.1.0.tar.gz (2.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

corrupt_tta-0.1.0-py3-none-any.whl (2.1 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: corrupt_tta-0.1.0.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0rc1

File hashes

Hashes for corrupt_tta-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e806df0438ae981d987e817fbea6c68051450ed0e068ba29eb862fd321a9f893
MD5 212fabd0237213eae35c961cb04b2e31
BLAKE2b-256 e9142bc273f2957b5c91b98a55d56c2213100bb891fcd54c3f01143a2d2570ff

See more details on using hashes here.

File details

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

File metadata

  • Download URL: corrupt_tta-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0rc1

File hashes

Hashes for corrupt_tta-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 27bf011982ae6dd07f8ecdaedea1779f5222036ebe44deccdb44d2f4d2c04134
MD5 884944cc712e6e19fee9815fb7ea776a
BLAKE2b-256 fd24ad1e8b7f9ce7cb692ea9b85f790494ce17d8b9fcee9cb80a06c42c6aaf8c

See more details on using hashes here.

Supported by

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