--- id: ttach version: "0.0.3" license: MIT license_treatment: permissive maintenance: abandoned --- # ttach — Images test time augmentation with PyTorch. License: permissive · Maintenance: abandoned · Downloads: 140.3K/mo ## What it is and what it does TTAch is a PyTorch wrapper library that implements test-time augmentation (TTA)—a technique where multiple augmented versions of an input image are passed through a trained model, and the resulting predictions are merged (averaged, max-pooled, etc.) to produce a final output. Instead of showing a model one clean image, TTA shows it many transformed versions and combines their predictions, often improving accuracy and robustness at the cost of inference time. The library provides pre-built wrappers for segmentation, classification, and keypoint detection models, along with a composable transform system (flips, rotations, scaling, crops, etc.) and multiple merge strategies (mean, geometric mean, max, min, temperature sharpening). You can wrap an existing model in one line and immediately use TTA, or build custom augmentation pipelines for specialized workflows. Use it for: - Improve segmentation model accuracy on medical images by averaging predictions across rotations and flips. - Boost classification confidence on edge cases by merging predictions from multiple scaled and cropped versions of the input. - Refine keypoint detection by applying TTA with geometric transformations and reversing them before merging. - Ensemble inference without training multiple models—apply TTA to a single model for a quick accuracy boost. - Benchmark model robustness by testing how predictions vary across different augmentations. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Wraps PyTorch models to apply test-time augmentation—running augmented versions of input images through a model and merging predictions to improve robustness. No—the package is abandoned (last release 2020-07-09, last commit 2023-07-28) with no maintenance or compatibility updates. While it has low install friction and permissive licensing, the lack of active maintenance poses a significant risk for compatibility with current PyTorch and Python versions. For active TTA support, consider maintained alternatives or implementing TTA directly in your training framework. ## Install pip install ttach uv add ttach poetry add ttach ## Installing ttach Before you install: Low friction install with no runtime dependencies. However, the package is abandoned—last release was 2020-07-09 and last commit 2023-07-28—so expect no maintenance, bug fixes, or compatibility updates for newer PyTorch or Python versions. License in practice: MIT license is permissive and places no restrictions on use, modification, or distribution in commercial or private projects. Quickstart: pip install ttach import ttach as tta model = ... # your trained PyTorch model tta_model = tta.SegmentationTTAWrapper(model, tta.aliases.d4_transform(), merge_mode='mean') predictions = tta_model(images) Requires PyTorch to be installed separately; the package itself has no runtime dependencies but will not function without a PyTorch model to wrap. Verify before relying: - Compatibility with current PyTorch versions (package last updated 2020-07-09). - Whether the package works with modern Python versions beyond 3.0 despite the broad classifier. - Performance impact of test-time augmentation on inference latency for typical model sizes. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: abandoned - Downloads: 140.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags test time augmentation pytorch, tta image segmentation, model prediction averaging, augmented inference pytorch, ensemble predictions images, tta classification wrapper, image augmentation at inference, test-time-augmentation, model-inference, computer-vision [View on SkillFed](https://skillfed.io/packages/ttach) · [View on PyPI](https://pypi.org/project/ttach/)