← 开源
conradry

copy-paste-aug

Copy-paste augmentation for segmentation and detection tasks

Model DevelopmentDataset engineeringJupyter Notebook
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
571
Star
74
Fork
+0
本周
1
贡献者
创建于 2020-12-19 · 更新于 2026-10-01 · 今日第 16811 名
主要开发者
conradry

conradry/copy-paste-aug 排名第 16,811,有 571 个星标。

同类别比较

conradry/copy-paste-aug 排名第 16,811,此处有 8 个同类条目;facebookresearch/omnivore 排名第 16,812。

同类别比较
名称排名指标
salesforce/PyRCA16,797
语言:
Python
星标数:
572
分叉数:
70
简介:
PyRCA: A Python Machine Learning Library for Root Cause Analysis
torrvision/siamfc-tf16,798
语言:
Python
星标数:
572
分叉数:
184
简介:
SiamFC tracking in TensorFlow.
KaihuaTang/Long-Tailed-Recognition.pytorch16,804
语言:
Jupyter Notebook
星标数:
571
分叉数:
70
简介:
[NeurIPS 2020] This project provides a strong single-stage baseline for Long-Tailed Classification, Detection, and Instance Segmentation (LVIS). It is also a PyTorch implementation of the NeurIPS 2020 paper 'Long-Tailed Classification by Keeping the Good and Removing the Bad Momentum Causal Effect'.
PJLab-ADG/3DTrans16,806
语言:
Python
星标数:
571
分叉数:
63
简介:
An open-source codebase for exploring autonomous driving pre-training
facebookresearch/omnivore16,812
语言:
Python
星标数:
571
分叉数:
40
简介:
Omnivore: A Single Model for Many Visual Modalities
jeya-maria-jose/UNeXt-pytorch16,815
语言:
Python
星标数:
571
分叉数:
86
简介:
Official Pytorch Code base for "UNeXt: MLP-based Rapid Medical Image Segmentation Network", MICCAI 2022
Diyago/Tabular-data-generation16,820
语言:
Python
星标数:
570
分叉数:
81
简介:
We well know GANs for success in the realistic image generation. However, they can be applied in tabular data generation. We will review and examine some recent papers about tabular GANs in action.
OpenDriveLab/OpenLane16,821
语言:
C++
星标数:
570
分叉数:
52
简介:
[ECCV 2022 Oral] OpenLane: Large-scale Realistic 3D Lane Dataset
关键参数与规格
关键参数与规格
参数值
语言Jupyter Notebook
类别Model Development
子类别Dataset engineering
关键词Computer vision, Data synthesis
星标数571
分叉数74
贡献者1
创建日期2020-12-19
更新日期2026-10-01
1 天星标数0
7 天星标数0
排名16,811
上次排名16,602
排名变化-209
7 天星标排名15,738
上次 7 天星标排名15,749
7 天星标排名变化11
总星标排名17,460
上次总星标排名17,431
总星标排名变化-29
README 摘录

Copy-Paste Unofficial implementation of the copy-paste augmentation from Simple Copy-Paste is a Strong Data Augmentation Method for Instance Segmentation. The augmentation function is built to integrate easily with albumentations. An example for creating a compatible torchvision dataset is given for COCO. Core functionality for image, masks, and bounding boxes is finished; keypoints are not yet supported. In general, you can use the CopyPaste augmentation just as you would any other albumentations augmentation function. There are a few

usage limitations of note. To attach class labels to a bounding box, directly append it to the bounding box coordinates. Bounding boxes passed to the CopyPaste augmentation must also include the index of the corresponding mask in the 'masks' list. the bounding box looks like (x1, y1, x2, y2, class_id, mask_index)). The CopyPaste augmentation expects 6 keyword arguments instead of three: 4. After pasting objects, the original bounding boxes may be occluded. To make things easier, the original

bounding boxes are just extracted from the updated masks. Integration with Torchvision datasets The idea is to have a standard torchvision dataset that's decorated for copy-paste functionality. The dataset class looks like: The only difference from a regular torchvision dataset is the decorator and the method instead of . To compose transforms with copy-paste augmentation: **Note: bbox params are NOT optional!

常见问题

记录了多少星标和分叉?

conradry/copy-paste-aug 有 571 个星标和 74 个分叉。

仓库排名是多少?

conradry/copy-paste-aug 排名第 16,811。

记录的语言和类别是什么?

conradry/copy-paste-aug 有 571 个星标,语言为 Jupyter Notebook,类别为 Model Development。

哪个仓库排名最接近?

conradry/copy-paste-aug 与 facebookresearch/omnivore 比较,后者排名第 16,812,有 571 个星标。

README

Copy-Paste

Unofficial implementation of the copy-paste augmentation from Simple Copy-Paste is a Strong Data Augmentation Method for Instance Segmentation.

The augmentation function is built to integrate easily with albumentations. An example for creating a compatible torchvision dataset is given for COCO. Core functionality for image, masks, and bounding boxes is finished; keypoints are not yet supported. In general, you can use the CopyPaste augmentation just as you would any other albumentations augmentation function. There are a few usage limitations of note.

Usage Notes

  1. BboxParams cannot have label_fields. To attach class labels to a bounding box, directly append it to the bounding box coordinates. (I.e. (x1, y1, x2, y2, class_id)).
  2. Bounding boxes passed to the CopyPaste augmentation must also include the index of the corresponding mask in the 'masks' list. (I.e. the bounding box looks like (x1, y1, x2, y2, class_id, mask_index)). An example is given for COCO.
  3. The CopyPaste augmentation expects 6 keyword arguments instead of three:
# typical albumentations transform
output = transforms(image=image, masks=masks, bboxes=bboxes)

# for the copy paste transform
output = transforms(
    image=image, masks=masks, bboxes=bboxes,
    paste_image=paste_image, paste_masks=paste_masks, paste_bboxes=paste_bboxes
  )
  1. After pasting objects, the original bounding boxes may be occluded. To make things easier, the original bounding boxes are just extracted from the updated masks.

Integration with Torchvision datasets

The idea is to have a standard torchvision dataset that's decorated for copy-paste functionality.

The dataset class looks like:

from copy_paste import copy_paste_class
from torch.utils.data import Dataset

@copy_paste_class
class SomeVisionDataset(Dataset):
    def __init__(self, *args):
        super(SomeVisionDataset, self).__init__(*args)

    def __len__(self):
        return length

    def load_example(self, idx):
        image_data_dict = load_some_data(idx)
        transformed_data_dict = self.transforms(**image_data_dict)
        return transformed_data_dict

The only difference from a regular torchvision dataset is the decorator and the load_example method instead of __getitem__.

To compose transforms with copy-paste augmentation:

import albumentations as A
from albumentations.pytorch.transforms import ToTensorV2
from copy_paste import CopyPaste

transform = A.Compose([
      A.RandomScale(scale_limit=(-0.9, 1), p=1), #LargeScaleJitter from scale of 0.1 to 2
      A.PadIfNeeded(256, 256, border_mode=0), #constant 0 border
      A.RandomCrop(256, 256),
      A.HorizontalFlip(p=0.5),
      CopyPaste(blend=True, sigma=1, pct_objects_paste=0.5, p=1)
    ], bbox_params=A.BboxParams(format="coco")
)

Note: bbox params are NOT optional!

排名相邻
同类项目