I have implemented the traffic light detection model in the code and test it returning the state (the given one) if it detects traffic lights or returning unknown state if it doesn't detect any traffic light.
For reducing detection inference time, I only pass 1 image every 10 images through the model and reduce the image dimensions cropping only the relevant zone where the traffic light is.
Depending on the machine, the inference can run faster so maybe one can reduce the image threshold to pass images with higher frequency through the model.
Once we have the trained classifier, we could pass the output of the detection model trough the classifier and finally obtain the traffic light state.
I have implemented the traffic light detection model in the code and test it returning the state (the given one) if it detects traffic lights or returning unknown state if it doesn't detect any traffic light.
For reducing detection inference time, I only pass 1 image every 10 images through the model and reduce the image dimensions cropping only the relevant zone where the traffic light is.
Depending on the machine, the inference can run faster so maybe one can reduce the image threshold to pass images with higher frequency through the model.
Once we have the trained classifier, we could pass the output of the detection model trough the classifier and finally obtain the traffic light state.