Solution for Zalo AI traffic signs detection.
Original implementation of RetinaNet by Srihari Humbarwadi
https://www.kaggle.com/phhasian0710/za-traffic-2020/download
After taking a quick look at the dataset, we can see that there are many small signs. Which makes the model hard to detect them. One of the possible methods in this scenario is Image Tiling
In detail, I will crop the image into a few parts with some overlaps, predict each part and the original image. Then combine the result using non-max suppression.
Data augmentation used for trainning includes:
- Random brightness adjustment (p=50%)
- Random contrast adjustment (p=50%)
- Auto crop a region contains at least 1 bouding box (p=50%)
- Random horizontal flipping (p=50%)
- Random gaussian blur or motion blur (p=50%)
python3 train.py --input {image_dir}\
--backbone resnet50\
--batch-size 4\
--checkpoint-dir /content/weights
python3 prediction.py --input {image_dir}\
--output submission.json\
--weight weights/weight_resnet50.h5\ # weight file should has format weight_{backbone}.h5
--save-dir /content/inference_images # or "" if you dont want to save images
--scales 896,1024 # Separated by comma
--tiling # Apply tiling if provided, useful for small objects
NOTE
This project is running on Google Colaboratory environment, so it may contain some issues when running on local machine, please don't hesitate to create a new issue