Data Augmentation for Custom Object Detection
Data Augmentation Steps for Custom Object Detection

So, If you are here then you might be enthusiast towards learning data augmentation, Object detection, machine learning, deep learning or image processing. And, you might have worked on image classification task where you might have done the data augmentation steps.
But, In Case of object detection, We have to draw bounding boxes for all the images. And, If we will apply the data augmentation steps then the number of images will increase and then again we need to do the labeling for those images. These is a method I will cover in this article how you can automate the labeling steps for augmented images.
What is “Data Augmentation” ?
Data augmentation is a strategy that enables practitioners to significantly increase the diversity of data available for training models, without actually collecting new data. Data augmentation techniques such as cropping, padding, and horizontal flipping are commonly used to train large neural networks.
We now have idea what is data augmentation.
If you have worked on data augmentation in Image Classification problems you might aware of some data augmentation steps like:
- Image Rotation
- Add Noise
- Image Flipping
- And, many others are there
Now, you might have thought how we can use these techniques for Object detection?? hmm The challenge is :
- Yes, we can try these mentioned methods and then we can again do the image labeling for all the newly created image. But, Seriously? are you going to repeat those labeling process for all the same but altered images? Big NO
So, here is a way:
- Why not we can just apply transformation for both the images and labels together? BOOM!! Yes, we will do the same transformation for image and label.
How
In this tutorial, we will use Jupyter Notebook to train our model. In the Jupyter Notebook, we can run a set of code snippets and get the output we want.
Installing Jupyter Notebook
Jupyter Notebooks are a part of Anaconda distribution and are open-source Use this link for installation. During installation it will ask for adding notebook to environment variable, I would suggest to check that checkbox.
After installation is complete, open the Anaconda prompt and type “Jupyter notebook”, and it will launch a Jupyter Notebook in your browser.

Click on “new” to open your new Python Notebook.
Converting yolo format to opencv
Below function will help us converting Yolo format label to opencv, It will help in rotating bounding boxes.



