'How to use the output of a CNN as the input of another in an autonomous vehicle
I am developing a mini autonomous car using 3 CNNs and a camera sensor using this approach.
One of the CNNs detects lanes on the images and outputs images with the lanes drawn in green
The other CNN uses the images to output the steering angles and speed which are communicated to the motor. These 2 CNNs work fine individually.
The last CNN detects traffic signs e.g. turn left, turn right, stop. How can I use this output to modify the way the first CNN draws the green lines. For example, if the car were at a junction with a turn left sign, I want the green lights "lanes" to draw a path to the left.
Any suggestions on how to connect these 3 CNNs and use them live would be much welcome.
Solution 1:[1]
For anyone who is wondering I was able to solve it with a simpler approach. I was able to detect the lanes and draw then in green just with opencv. I built a CNN that outputs the steering angle and another one that outputs the speed. These two CNNs where able to also learn the traffic signs and act accordingly so there was no need for another neural network. In my predict file, I then import these 2 CNNs as models, then process each image frame with opencv before using the models seperately to predict steering angle and speed. The car was good to go with these values.
By the way, here is how the output of a CNN can be used as the input of another one. Just use the output as a parameter when using the second CNN to predict ( "secondmodel.predict(output,.....)" in keras for example)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | IsmaelSad |