Skip to main content

ODAch is a test-time-augmentation tool for pytorch 2d object detectors.

Project description

ODAch, An Object Detection TTA tool for Pytorch

ODA is a test-time-augmentation (TTA) tool for 2d object detectors.

For use in Kaggle object detection competitions.

:star: if it helps you! ;)

Install

pip install odach

Usage

See Example.ipynb.

The setup is very simple, similar to ttach.

Singlescale TTA

import odach as oda
# Declare TTA variations
tta = [oda.HorizontalFlip(), oda.VerticalFlip(), oda.Rotate90(), oda.Multiply(0.9), oda.Multiply(1.1)]

# load image
img = loadimg(impath)
# wrap model and tta
tta_model = oda.TTAWrapper(model, tta)
# Execute TTA!
boxes, scores, labels = tta_model(img)

Multiscale TTA

import odach as oda
# Declare TTA variations
tta = [oda.HorizontalFlip(), oda.VerticalFlip(), oda.Rotate90(), oda.Multiply(0.9), oda.Multiply(1.1)]
# Declare scales to tta
scale = [0.8, 0.9, 1, 1.1, 1.2]

# load image
img = loadimg(impath)
# wrap model and tta
tta_model = oda.TTAWrapper(model, tta, scale)
# Execute TTA!
boxes, scores, labels = tta_model(img)
  • The boxes are also filtered by nms(wbf default).

  • The image size should be square.

model output wrapping

# wrap effdet
oda_effdet = oda.wrap_effdet(effdet)
# Declare TTA variations
tta = [oda.HorizontalFlip(), oda.VerticalFlip(), oda.Rotate90()]
# Declare scales to tta
scale = [1]
# wrap model and tta
tta_model = oda.TTAWrapper(oda_effdet, tta, scale)

Example

Global Wheat Detection

Example notebook

Thanks

nms, wbf are from https://kaggle.com/zfturbo

tta is based on https://github.com/qubvel/ttach, https://github.com/andrewekhalel/edafa/tree/master/edafa and https://www.kaggle.com/shonenkov/wbf-over-tta-single-model-efficientdet

Project details


Download files

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

Source Distribution

odach-0.1.5-2107010420.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

odach-0.1.5.post2107010420-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file odach-0.1.5-2107010420.tar.gz.

File metadata

  • Download URL: odach-0.1.5-2107010420.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for odach-0.1.5-2107010420.tar.gz
Algorithm Hash digest
SHA256 cff72db0f5f506106095a18a785bb1a1bead47c5490be506fa0a516efc57ddb0
MD5 00b2394108ba6bf80227e57efe75e768
BLAKE2b-256 e56511168b0dfb45a03b2a2c05c67811399eda778e2c90befb63ae462404be22

See more details on using hashes here.

File details

Details for the file odach-0.1.5.post2107010420-py3-none-any.whl.

File metadata

  • Download URL: odach-0.1.5.post2107010420-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for odach-0.1.5.post2107010420-py3-none-any.whl
Algorithm Hash digest
SHA256 92a09efa1ab0cf1c925dbc9e4809811fa75fd75311c5ce45705f1e5564cc2e27
MD5 26c100ceed860cd1842fed335ceef638
BLAKE2b-256 c4c647017993786130e6d81541e221d38a3519aa6ec06ec24c01cc1bcfdfb285

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page