Registry / ai-ml / ttach
library0.0.3pypypiunverified

Image test time augmentation for PyTorch. Wraps models to apply TTA transforms (flips, rotations, scaling) and aggregate predictions. Current version 0.0.3, last release April 2021. No recent updates; library is in maintenance mode.

pip install ttach
INSTALL
IMPORT
SIG · TTACH
T
ttach
ai-mlpythonv0.0.3
Install
1.5s avg
Import
—
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.0.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.9MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Compose
✓ from ttach import Compose
✗ from ttach import Compose

Basic TTA example: wrap a model with horizontal flip, 90° rotation, and scaling. Merge predictions by mean.

import torch import ttach as tta model = torch.nn.Linear(10, 2) # dummy model model.eval() transforms = tta.Compose([ tta.HorizontalFlip(), tta.Rotate90(angles=[0, 90]), tta.Scale(scales=[1.0, 1.5]), ]) tta_model = tta.SegmentationTTAWrapper(model, transforms, merge_mode='mean') input_tensor = torch.randn(1, 10) output = tta_model(input_tensor) print(output.shape)
Debug
Known issues
deprecatedThe library has not been updated since April 2021. It may not work with newer PyTorch versions without issues.
fix
Consider alternatives like kornia's kornia.augmentation.TTA or torchvision's test-time augmentation utilities.
affects: >=0.0.3
gotchaThe 'd4' transform alias was fixed in v0.0.2 to remove duplicated augmentations. If using older version, you might get unintended duplicates.
fix
Upgrade to >=0.0.2 or manually define the D4 transform using Compose.
affects: <0.0.2
breakingKeypoints support was added in v0.0.3. If you rely on keypoints, ensure version >=0.0.3 or use a workaround.
fix
Upgrade to 0.0.3 or handle keypoints manually.
affects: <0.0.3
Upgrade
Version history
0.0.3latest on PyPI · released Jul 9, 2020
Audit
Dependencies
torchrequiredCore dependency for PyTorch tensors and models.
Agent activity
20 hits · last 30 days
node
18
OpenAI (training)
1
Resources
ttach — pip install ttach · libregistry