Creating synthetic dataset for object classification with rotated bounding boxes
pip install randimage numpy opencv-python matplotlib pyyaml tqdm
Prepare target objects:
- Collect multiple images of the target objects. Ideally if they are fairly isolated.
- Isolate the target object from the background. To remove the background, you could use any tools such as rembg. If the image is JPG/JPEG, make sure to make the background flat white, it will be automatically removed during generation of the dataset.
- Crop to the size of the object. This will be used as the bounding box when generating the synthetic dataset.
Set the configuration parameters in the config.yaml
. Directory containing the images that will be used as background as well as the target objects images from the prior step and more.
Execute the script
python synthetic_dataset_generator.py