"Give me a sign!"
- Britney Spears, Circa October 23, 1998
"Jerry, just remember, it's not a lie if you believe it."
- George Costanza (Seinfeld), Circa July 5, 1989
This repository collates our efforts on building traffic sign detection model in low (to zero) sample regime (with little to no human annotations). We leverage templates of known traffic signs to train our detector. We married the ideas of synthetic text & object detection for this work to bear fruit. We provide a pre-trained traffic sign detection model trained on 169 German Traffic sign(s). Sample results
You can either install the code in a virtual environment or docker. Use the docker if you want a reproducible environment.
First, create a virtual environment:
conda create -n synth-signs
conda activate synth-signs
conda install pip
Then install dependencies and software:
pip install . # If you only want to generate a dataset.
pip install .[inference] # Include Inference
pip install .[trainer] # Include Model training
The following two commands install and run the docker image:
make docker-install
make docker-run
Download the pre-trained model(.pth) from here at resources/models
.
detect-synthetic-signs --images=synthetic_signs/images/test_samples/*.jpg \
--label-map=resources/labels/labels-DE-169.yaml \
--config=resources/models/DE-signs-169.yaml \
--weights=resources/models/DE-signs-169.pth \
--output-dir=/tmp/signfeld
visualize-synthetic-sign-detections --images=synthetic_signs/images/test_samples/*.jpg \
--template-dir=synthetic_signs/templates \
--detections=/tmp/signfeld \
--destination=/tmp/signfeld-viz \
--min-confidence=0.5
Disclaimer : The model was trained with zero real samples, and is known to miss signs which are obscure, small and skewed from camera axis.
Trained models are include in the repository [Calzone]. Evaluated on GTSDB
Name | Description | GTSDB mAP | Remarks |
---|---|---|---|
Calzone | Detector: RetinaNet, backbone: ResNet 50 | 67.23 | Location : download |