Skip to content

Tool to generate synthetic images with YOLO annotations

License

Schapagain/scatter-yolo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scatter YOLO

This is a tool to generate synthetic images where provided images of objects are scattered over a white background or over optionally provided background images.

Installation

As this is not yet published in PyPI, manual installation is required.

  1. Clone this repository to local

    git clone git@github.com:schapagain/scatter-yolo.git
  2. Create a new virtual environment and install flit

    conda create -n scatter-yolo flit
  3. In the root project directory run:

    flit install
    
  4. Now you can start using the tool with. To check out all the generation options, run:

    scatter-yolo generate -h
    

Usage Examples

Scatter one or more objects

scatter-yolo generate samples/images/fish samples/images/turtles

29fish-26turtles

Add backgrounds

scatter-yolo generate samples/images/fish samples/images/turtles -b samples/images/ocean_bed

25fish-29turtles

Generate multiple images

scatter-yolo generate samples/images/fish samples/images/turtles -b samples/images/ocean_bed -c 2

35fish-23turtles|28fish-27turtles

Change object ratios

scatter-yolo generate samples/images/fish samples/images/turtles -b samples/images/ocean_bed -rat 0.2,0.8

8fish-45turtles

Change total object count (approx*)

scatter-yolo generate samples/images/fish samples/images/turtles -b samples/images/ocean_bed -min 10 -max 20

8fish-4turtles

* The exact count of scattered objecs cannot be set, and only min and max counts are accepted. The max parameter is a true maximum, however there might be fewer objects than the min parameters (if there is no space to place enough objects in the image, for example). This is to vary the number of objects in each image when doing bulk generation.

Change object size

scatter-yolo generate samples/images/fish samples/images/turtles -b samples/images/ocean_bed -min 10 -max 20 -os 50

7fish-5turtles

Add circular mask

scatter-yolo generate samples/images/fish samples/images/turtles -b samples/images/ocean_bed -sh circ

27fish-30turtles

Reduce spread

scatter-yolo generate samples/images/fish samples/images/turtles -b samples/images/ocean_bed -cx 0.8

28fish-26turtles

Generate placement animation

scatter-yolo generate samples/images/fish samples/images/turtles -b samples/images/ocean_bed -anim yes

24fish-31turtles

About

Tool to generate synthetic images with YOLO annotations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages