Skip to main content

Data Synthesis pipeline to generate object detection data

Project description

Object Detection Data Synthesis

Data Synthesis pipeline to generate object detection data

Alt text

How to run

Run with pip

pip install mdetsyn

And run in python file

from mdetsyn import run_synthesis, create_args

args = create_args()
run_synthesis(args)

Run with command line

python synthesis.py --backgrounds ./backgrounds \
                    --objects ./objects \
                    --savename ./synthesis \
                    --number 1000 \
                    --class_mapping ./class_mapping.json \
                    --class_txt ./classes.txt

Sample

  • Backgrounds folder contain background images (in any folmat)
├── backgrounds/
    ├── background-0.jpg
    ├── background-1.jpg
    └── ...
  • Objects folder contain object images in subfolders (the best is .png format with A channel but any format is still runnable)
├── objects/
    ├── class_1/
    │   ├── image-0.png
    │   ├── image-1.png
    │   └── ...
    ├── class_2/
    └── ...
  • Each image in objects folder will be synthesis by n times with n is user input

  • Output is a synthesis folder contain images and labels dir same as YOLO format

  • Sample visualization:

Background Object Synthesis

Support synthesis methods

  • Random Resize
  • Random Rotate
  • Random Transparency
  • Random Perspective Transform
  • Seamless Clone
  • Grayscale

Error and TODO

  • Sometimes seamless clone does not work
  • Input parameter for each augment
  • Add default arguments to argparse help

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mdetsyn-0.0.4.post1.tar.gz (6.3 kB view hashes)

Uploaded Source

Built Distribution

mdetsyn-0.0.4.post1-py3-none-any.whl (6.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page