OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Developer Tools & SDKs

Ttach

Ttach is an open-source Python library that adds test-time image augmentation to PyTorch inference. It transforms inputs, runs them through a model, reverses corresponding transformations on outputs, and combines predictions for classification, segmentation, and keypoint tasks.

Independent OpenViST project profile, based on linked sources.

Ttach — OpenViST project profile in AI Developer Tools & SDKs.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use Ttach when an existing PyTorch image-inference pipeline should evaluate transformed versions of inputs and combine the corresponding predictions.

Who it is for

  • PyTorch developers adding augmented views to image-model inference
  • Computer-vision practitioners working with classification, segmentation, or keypoint models
  • Developers implementing custom multi-input or multi-output augmentation processing

Documented uses

  • Wrap a classification model with crop-based test-time augmentation.
  • Apply transforms to segmentation inputs and merge deaugmented predictions.
  • Use flip-based augmentation with keypoint models that return coordinates in the specified tensor format.
  • Compose transforms such as flips, rotations, scaling, and intensity changes.
  • Build custom processing that augments inputs, deaugments selected outputs, and reduces results.
Before you choose

Requirements & limits

The repository identifies the project as open source under the MIT license. The README documents installation through PyPI or directly from GitHub.

  • The library requires an existing PyTorch model and inference workflow.
  • The number and type of transforms determine how many augmented inputs are processed; the README's custom example combines four transform groups into 36 augmentations.
  • Merge options include mean, geometric mean, sum, max, min, and temperature sharpening.
  • Keypoint models must return coordinates in the documented torch([x1, y1, ..., xn, yn]) format.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Wrap a segmentation model with D4 test-time transforms

Configure a segmentation model wrapper using D4 transforms and mean prediction merging.

Before you start

  • Python environment with PyTorch and Ttach installed
  • An existing segmentation model

Steps

  1. Install Ttach from PyPI with the command below.

    Documented command
    pip install ttach
  2. Import the library as tta.

  3. Create a SegmentationTTAWrapper around the model using tta.aliases.d4_transform() and merge_mode='mean'.

Expected outcome

A segmentation model wrapped to apply D4 transformations and merge predictions by mean.

Guide limitations

  • The documented example configures the wrapper but does not describe a complete input or inference invocation.
  • The example assumes an existing model.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
16 October 2026
Original website title
qubvel/ttach · Official homepage title · retained in its source language