Skip to content
unknown edited this page Oct 1, 2021 · 15 revisions

Build Status codecov.io MIT license Generic badge Downloads

augmixations

Some augmentations that I hasn't found in other repositories and libraries.

Current augmentations:

Cutmix

Dependencies

  • numpy>=1.11.1

Default Cutmix for classifiers

Original Cutmix Paper

Current cutmix

Getting Started

pip install augmixations  

Example with default parameters

Import:

from augmixations import Cutmix, Cutout, Mixup  

Using Cutmix:

#  bg_img - The image into which a rectangle will be inserted  
#  fg_img - The image from which a random rectangle will be cut 
cutmix = Cutmix()
img, boxes, labels = cutmix(bg_img, bg_boxes, bg_labels,
                            fg_img, fg_boxes, fg_labels)  

Done.

Using Cutout:

cutout = Cutout()
new_img, new_boxes, new_labels = cutmix(img, boxes, labels)

Done.

Using Mixup:

mixup = Mixup()
image, boxes, labels = mixup(first_img, first_boxes, first_labels, 
                             second_img, second_boxes, second_labels)

Done.

Advansed usage

You can pass special configs to the cutmix function to override its behavior.

Cutmix Advanced Usage

Contacts

Issues should be raised directly in the repository. For professional support and recommendations please welcomedenk@gmail.com.