Coder Social home page Coder Social logo

rotational-data-augmentation-yolo's Introduction

Rotational Data Augmentation for YOLO

Requirement

numpy
opencv-python

Before and after

Before: the block at left-top corner is bounded by a white box.

After: Image is rotated anticlockwise by 30 degree and the block is still bounded by the white box.

Directory structure

.
├── check_label.py
├── rotation.py
├── data_original
│   ├── images
│   │   └── test00.png
│   └── labels
│       └── test00.txt
└── data_rotational
    ├── images
    │   ├── test00_000.jpg
    │   ├── test00_030.jpg
    │   └── ...
    └── labels
        ├── test00_000.txt
        ├── test00_030.txt
        └── ...

data_original is directory with your images and labels. After running rotation.py, rotated images and labels will be stored in data_rotational.

Generate augmented data

python rotation.py DATASET_INPUT

DATASET_INPUT is data_original in this example. The default output destination directory is data_rotational.

You can use python rotation.py -h to get more information.

Visualize generated images and labels

python check_label.py DATASET_INPUT

DATASET_INPUT is data_rotational in this example.

You can use python check_label.py -h to get more information.

rotational-data-augmentation-yolo's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

rotational-data-augmentation-yolo's Issues

It will generate additional error labeling

Hi,
I have used your code to generate more data, howerver, it generates an additional labeling. In my case, if my labeling amount is four of one pictrure, and it generates five labeling, and the fifith labeling value is similar with the fourth labeling value.
Can you give me some advice about this situation? Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.