yaboo-oyabu / CarND-Capstone

MIT License
2 stars 2 forks source link

Use retrained detection model #27

Closed jotredi closed 4 years ago

jotredi commented 4 years ago

I have changed the code in detector.py so that now uses the retrained model and doesn't need to download the model from the internet either (and doesn't require wget). The code assumes that the folder ssd_inception_v2_retrained_2806 with the retrained model is stored in /light_classification/tl_detection.

I have also changed the code in tl_detector.py so that when the car doesn't detect the traffic light, it is able to return the waypoint that it needs to stop at if the last detected state was red (line 136). If the last detected state wasn't red it should return -1 (line 142).

Testing the model the car passed a red light because it received these detected states ('red', 'red', 'red', 'unknown', 'unknown', 'unknown', 'unknown', 'unknown' and then red again but it didn't have time to stop). Adding that now the car stops during those unknowns.

I have also changed the logic in cropping the images (line 187) so that it only crops the lower half of the image if the car is farther than 100 wps from the traffic light because maybe it could crop the traffic light in some situations.

I guess we could just not use that logic and give the full image but doing that I still have latency issues even in the workspace and the car sometimes doesn't follow the waypoints if the latency is high but whatever you guys think is better :). Maybe you don't have those issues.

yaboo-oyabu commented 4 years ago

@jotredi I merged your code. Btw, I think you didn't include the detection model in this PR... ?

jotredi commented 4 years ago

No cause I think the model is bigger than the Github limit of 100 MB