Skip to main content

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

Release files for mdetsyn 0.0.4.post1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mdetsyn 0.0.4.post1
File Size Uploaded
mdetsyn-0.0.4.post1.tar.gz 6.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mdetsyn 0.0.4.post1
File Interpreter ABI Platform
mdetsyn-0.0.4.post1-py3-none-any.whl Python 3 none any Details

Total release size: 13.2 kB

Release files / mdetsyn-0.0.4.post1.tar.gz

Download URL mdetsyn-0.0.4.post1.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a7eafb5cb5df1bfa61d886e8730d512be7fdfd789aafada35def0b26b6ae3528
BLAKE2b-256 checksum
How to use checksums
9f32476c13ae6cfa7f4ff177017839ee604bc1fe6ca011e8ca9def7a974bc8a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.10

Release files / mdetsyn-0.0.4.post1-py3-none-any.whl

Download URL mdetsyn-0.0.4.post1-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c7dd58aba59b2a8a7456d5a45d694fd68f913eadbe8732b8c1b6e825a358fcf8
BLAKE2b-256 checksum
How to use checksums
0d221226b3c58600c9d82a2fe2feb9b633f767b86deca641d31048ad315af027
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.0.4.post1 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page