Coder Social home page Coder Social logo

mosaic_data_augmentation_yolo's Introduction

This is an implementation for mosaic image augmention with YOLO format

Run code to perform mosaic augmentation:

python main.py --width 800 --height 800 --scale_x 0.4 --scale_y 0.6 --min_area 500 --min_vi 0.3

You can change parameters to fit with your dataset. To know details about arguments in the command above, run

python main.py --help
  • --width: width of mosaic-augmented image
  • --height: height of mosaic-augmented image
  • --scale_x: scale_x - scale by width => define width of the top left image
  • --scale_y: scale_y - scale by height => define height of the top left image
  • --min_area: min area of box after augmentation we will keep
  • --min_vi: min area ratio of box after/before augmentation we will keep

Example

With 4 input images

Image 1 Image 2 Image 3 Image 4

Output mosaic augmented image with YOLO format

Mosaic-augmented image Image with bboxes

Notes

  • Original images in the folder images
  • Orginal labels (bounding boxes) in the folder labels
  • Image and label have the same name. For example: img_0.jpeg - img_0.txt.
  • Format of image can be: .jpg, .jpeg, .png ...
  • Mosaic-augmented images will be in the folder augmentation/mosaic_images. New labels will be in the folder augmentation/mosaic_labels. These folder will be automatically created when you run the code above.

mosaic_data_augmentation_yolo's People

Contributors

huytranvan2010 avatar

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.