Copy Paste

If you have ever worked on a Computer Vision project, you might know that using augmentations to diversify the dataset is the best practice. On this page, we will:

  • Сover the Copy Paste augmentation;

  • Check out its parameters;

  • See how Copy Paste affects an image;

  • And check out how to work with Copy Paste using Python.

Let’s jump in.

To define the term, Copy Paste is a data augmentation technique explicitly designed for the Instance Segmentation tasks. In short, the transform stands for its name and simply implements the mechanism of randomized pasting instances from image A to image B.

With such an approach and the right parameters, researchers can try to avoid the class imbalance problem or get better starting conditions for a Few-Shot Learning task.

Please note that as of today, Copy Paste does not show in the transform preview in the Model Playground environment.

Parameters

  • Blend flag defines whether to use Gaussian smoothing on pasted targets;

  • Sigma - the standard deviation for Gaussian kernel;

  • Object Paste Percentage - defines how many objects to paste from other images;

  • Probability of applying transform - defines the likelihood of applying Copy Paste to an image.

Source

Copy Paste augmentation was proposed in late 2020, so it did not have enough time yet to conquer the world and become a must-have augmentation when solving an Instance Segmentation task. This is why Albumentations does not have a separate Copy Paste transform function.

Still, if you want to use Copy Paste, you do not need to code it manually. There are different implementations of this augmentation out on the Web. For example, please check out the GitHub repository featuring a ready-made Copy Paste function you can straightaway use for your project.

Last updated on Oct 17, 2022

Get AI confident. Start using Hasty today.

Automate 90% of the work, reduce your time to deployment by 40%, and replace your whole ML software stack with our platform.

Start for free Request a demo