https://github.com/pd-mera/object-detection-data-synthesis
Synthesis data in YOLO format given background and object images
https://github.com/pd-mera/object-detection-data-synthesis
data-synthesis yolo
Last synced: 3 months ago
JSON representation
Synthesis data in YOLO format given background and object images
- Host: GitHub
- URL: https://github.com/pd-mera/object-detection-data-synthesis
- Owner: PD-Mera
- Created: 2024-04-24T06:52:37.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-05-08T10:24:33.000Z (about 1 year ago)
- Last Synced: 2025-01-08T19:46:54.190Z (5 months ago)
- Topics: data-synthesis, yolo
- Language: Python
- Homepage:
- Size: 485 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Object Detection Data Synthesis
Data Synthesis pipeline to generate object detection data
## How to run
### Run with pip
``` bash
pip install mdetsyn
```And run in python file
``` python
from mdetsyn import run_synthesis, create_argsargs = create_args()
run_synthesis(args)
```### Run with command line
``` bash
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
- [x] Input parameter for each augment
- [ ] Add default arguments to argparse help