This project focuses on detection of 3 sets of Indian vehicles using Retinanet Model.
The model used is trained on a dataset containing three sets of Indian vehicles - Cars, Motorbikes and Autos. The dataset comprising of about 10,000 pictures was collected manually and was labelled using tool LabelMe.
RetinaNet is a popular single-stage detector, which is accurate and runs fast.
RetinaNet uses a feature pyramid network to efficiently detect objects at multiple scales and introduces a new loss, the Focal loss function, to alleviate the problem of the extreme foreground-background class imbalance.
Weights of trained model - /models/vds_weights.h5
- Python3
- Keras
- Tensorflow
- Keras_retinanet
- CV2
-
Download weights and copy it to the models directory. It contains weights of the trained model.
-
Execute predict.py file.
python predict.py
-
To input an image, save the image in root directory and change the image name in function read_image_bgr in predict.py. (example - test.jpeg)
-
You can also tweak the threshold score. (Detector will only detect those images in the output where confidence score is greater than threshold.)