Copy and Paste Implementation for Semantic Segmentation. Link to the paper.
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.
- 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)
- Put
SemanticCopyandPaste()
before other albumentations augmentation (See demo here) - Then follow other augmentation such as flip, transpose, random crop, etc.
Before Augmentation:
After Augmentation:
Another Example using another dataset:
@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}}
}