Metadata-Version: 2.4
Name: corrupt_tta
Version: 0.1.2
Summary: A modernized library for image corruptions based on ImageNet-C
Author-email: Manus AI <support@manus.im>
Project-URL: Homepage, https://github.com/YashM8/robustness/tree/modernize-corruptions
Project-URL: Repository, https://github.com/YashM8/robustness/tree/modernize-corruptions
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering :: Image Processing
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: numpy
Requires-Dist: opencv-python
Requires-Dist: pillow
Requires-Dist: scipy
Requires-Dist: scikit-image

# 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

```bash
pip install corrupt_tta
```

## Usage

```python
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`

## Citation

If you find this useful in your research, please consider citing:

```bibtex
@article{hendrycks2019robustness,
  title={Benchmarking Neural Network Robustness to Common Corruptions and Perturbations},
  author={Dan Hendrycks and Thomas Dietterich},
  journal={Proceedings of the International Conference on Learning Representations},
  year={2019}
}
```

## License

MIT
