Skip to content
项目

KupynOrest/instance_augmentation

在 GitHub 查看

KupynOrest/instance_augmentation has 52 GitHub stars and 4 forks. GitHot measured 0 stars in 24 hours, 0 in 7 days, and 0 in 15 days. Last checked 2026-11-18 13:37 UTC. Last push 2024-09-02.

这些数字如何统计

实测星标增长

24小时
0
7天
0
15天
0
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

关于

[ECCV 2024] Official Repo for: Dataset Enhancement with Instance-Level Augmentations

机器学习

README.md

原文

Dataset Enhancement with Instance-Level Augmentations

Paper Conference Project WebPage

This is an official repository for the paper

Dataset Enhancement with Instance-Level Augmentations
Orest Kupyn, Christian Rupprecht
ECCV 2024

Instance Augmentation method augment images by redrawing individual objects in the scene retaining their original shape. This allows training with the unchanged class label (e.g. class, segmentation, detection, etc.). The generations are highly diverse and match the scene composition

Original Augmented Augmented

Augmented Datasets

This repository contains links to several augmented datasets that can be used for various computer vision tasks, such as object detection, instance segmentation, and saliency detection.

Datasets

  1. COCO Augmented Car:

  2. COCO Augmented People:

  3. COCO Augmented:

  4. DUTS Augmented:

  5. DUTS SDXL (Experimental):

  6. SHA512 Checksums:

Please note that these augmented datasets are provided for research purposes. If you plan to use these datasets in your projects, make sure to follow the appropriate licensing and citation requirements.

Installation

The code uses Python 3.8.

Create a Conda virtual environment and Install The Package:

Make sure you have Conda installed.

make env

Run Test for the Package:

make pytest

Run on a folder of images:

An example is available in tests/test_pipeline.py - test_end_to_end

To predict instance masks:

from instance_augmentation.pseudolabel_dataset import create_annotations

create_annotations("path_to_image_folder", "path_to_save_results", dataset_type="custom", class_names=["dog", "cat", "any_other_classes"])

To generate augmented images:

from instance_augmentation.pipeline.dataset_generator import DatasetGenerator
from instance_augmentation.pipeline.readers import CustomDatasetReader

reader = CustomDatasetReader("path_to_image_folder", {}, "path_to_save_results/annotations.json")
dataset_generator = DatasetGenerator.from_params(
        dataset_reader=reader,
        save_folder="path_to_save_results",
        preprocessing="resize",
        target_image_size=1024,
        base_inpainting_model="SG161222/RealVisXL_V3.0",
        generator="inpaint_sdxl_adapter",
        num_samples=1,
        num_inference_steps=20,
        control_methods=["t2i_depth", "t2i_sketch"],
        control_weights=[0.9, 0.5],
    )
    dataset_generator.run()

To apply augmentations:

import os
import cv2
import glob
from instance_augmentation.augment import Augmenter

augmenter = Augmenter("path_to_save_results", p=1.0)
for image_path in glob.glob("path_to_image_folder/*"):
    image_name = os.path.split(image_path)[1]
    original_image = cv2.cvtColor(cv2.imread(image_path), cv2.COLOR_BGR2RGB)
    augmented_image = augmenter.augment_image(original_image, image_name)

Citation

If you use the the method or this code - implicitly or explicitly - for your research projects, please cite the following paper:

@article{kupyn2024dataset,
    title = {Dataset Enhancement with Instance-Level Augmentations},
    author = {Kupyn, Orest and Rupprecht, Christian},
    journal = {arXiv preprint arXiv:2406.08249},
    year = {2024}
  }