Source: Deep Learning on Medium
Before we can train our model, we need to gather lots of data, in this case, images. A minimum of 200 images should be fine, depending on the complexity of the detector.
If we want our model to be as robust as possible, our images should differ from each other in terms of lighting and background, so the model can generalize better.
These images can either be taken from your phone or obtained from the Internet.
Here you can see a subset of my Pill Detector model:
After gathering data, we need to resize our images because some of them may be pretty big. Smaller images will mean our model will train faster.
To do so, I wrote the following script: