Skip to content

Simple Copy and Paste Implementation for Semantic Segmentation (Data Augmentation)

License

Notifications You must be signed in to change notification settings

WeiChihChern/Copy-Paste-Semantic-Segmentation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Copy-and-Paste

Copy and Paste Implementation for Semantic Segmentation. Link to the paper.


Data format

The required masks images should contains class idx as pixel intensity rather than color encoded. For instance, pixels belongs to class #0 should have pxiels values as 0, and class #1 should have 1s.

An example can be found here. Though you might not see the mask because each class has low intensity values.

Current Status

  • Tested. Works with albumentations. (See demo here)
  • Current implementation contains copy then paste only. No instance level copy and paste.
  • Paste with transaltion (x,y shift) supported.
  • Rotation and Scaling supported.
  • Augmentation probability control added, so you can ignore/increase augmentation probability to certain class(es)

How to use:

  1. Put SemanticCopyandPaste() before other albumentations augmentation (See demo here)
  2. Then follow other augmentation such as flip, transpose, random crop, etc.

Before and After

Before Augmentation:

After Augmentation:

Another Example using another dataset:
Screen Shot 2021-08-17 at 11 47 23 PM

Citing

@misc{Chern:2021,
  Author = {Wei Chih Chern},
  Title = {Copy-Paste for Semantic Segmenetation},
  Year = {2021},
  Publisher = {GitHub},
  Journal = {GitHub repository},
  Howpublished = {\url{https://github.com/WeiChihChern/Copy-Paste-Semantic-Segmentation}}
}

About

Simple Copy and Paste Implementation for Semantic Segmentation (Data Augmentation)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published