Skip to main content

Test Time Augmentation (TTA) wrapper for computer vision tasks: segmentation,classification, super-resolution, ... etc.

Project description

Edafa

Edafa is a simple wrapper that implements Test Time Augmentations (TTA) on images for computer vision problems like: segmentation, classification, super-resolution, Pansharpening, etc. TTAs guarantees better results in most of the tasks.

Installation

pip install edafa

Getting started

The easiest way to get up and running is to follow example notebooks for segmentation and classification showing effect of TTA on performance.

How to use Edafa

The whole process can be done in 4 steps:

  1. Import Predictor class based on your task category (Segmentation or Classification)
from edafa import SegPredictor
  1. Inherit Predictor class and implement the main function
    • predict_patches(self,patches) : where your model takes image patches and return prediction
class myPredictor(SegPredictor):
    def __init__(self,model,*args,**kwargs):
        super().__init__(*args,**kwargs)
        self.model = model

    def predict_patches(self,patches):
        return self.model.predict(patches)
  1. Create an instance of you class
p = myPredictor(model,patch_size,model_output_channels,conf_file_path)
  1. Call predict_images() to run the prediction process
p.predict_images(images,overlap=0)

Configuration file

Configuration file is a json file containing two pieces of information

  1. Augmentations to apply (augs). Supported augmentations:
    • NO : No augmentation
    • ROT90 : Rotate 90 degrees
    • ROT180 : Rotate 180 degrees
    • ROT270 : Rotate 270 degrees
    • FLIP_UD : Flip upside-down
    • FLIP_LR : Flip left-right
  2. Combination of the results (mean). Supported mean types:
    • ARITH : Arithmetic mean
    • GEO : Geometric mean

Example of a conf file

{
"augs":["NO",
"FLIP_UD",
"FLIP_LR"],
"mean":"ARITH"
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for edafa, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size edafa-0.1.1-py3-none-any.whl (6.9 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size edafa-0.1.1.tar.gz (5.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page