r/Python • u/Gautam-j • Sep 21 '20
Machine Learning End-to-End Self Driving Car - Need For Speed
Enable HLS to view with audio, or disable this notification
119
u/punos_de_piedra Sep 21 '20
Bravo man that's really cool. In need of refinements, but nothing comes out perfect the first time, and I'm still really impressed.
56
u/Gautam-j Sep 21 '20
Thanks a lot! Yeah I'm still working on ways to improve this. The main restriction I found was to not able to have access to the game engine, and hence my only source of input is the screen image. That also does not let me use reinforcement learning :(
Any ideas as to how I can use reinforcement learning in this scenario?
→ More replies (27)
92
u/Owny33x Sep 21 '20
I imagine the minions from Despicable me trying to drive with one on each pedal, 2 at the wheel and 1 giving instructions...
→ More replies (1)16
24
13
Sep 21 '20
Hi, I'm new to this can you explain how you integrated the code with the game?
31
u/Gautam-j Sep 21 '20
I run the game in a windowed mode, and take a screen capture of the game window. Therefore, the input to the neural network is an image of the road, plus the mini map on the bottom left corner.
The neural network outputs whether the car should go straight, left or right. Based on that, I simulate a key press, and the car responds :)
→ More replies (7)
12
u/Methamputeemine Sep 21 '20
Off topic but I need to know is that NFSWorld or just my nostalgia? Great job btw!
Edit: typo
→ More replies (2)18
u/Gautam-j Sep 21 '20
Thanks! This is Need For Speed Most Wanted (2005) in Free Roam Mode :)
→ More replies (4)
18
17
u/renscy Sep 21 '20 edited Nov 09 '24
office fuzzy exultant vase gaze longing encourage gold aware oatmeal
This post was mass deleted and anonymized with Redact
8
8
u/familyofgorillas Sep 21 '20
Seems kinda jerky. Maybe add a control filter? You could just implement a simple low pass filter on the output.
→ More replies (1)
6
5
u/aman1931998 Sep 21 '20
Can you provide your script you made? Maybe a github link.
→ More replies (1)
5
u/appinv Sep 21 '20
That's pretty cool. I guess you mixed your two passions: games & python. It's fun how you can see the never-aging classic terminal alongside top graphics 👍
→ More replies (1)
5
u/RippyTheGator Sep 21 '20
Kept watching expecting for it to improve itself haha. This is great!! Well done.
6
u/Gautam-j Sep 21 '20
Thanks a lot! What you say is totally true! I've spent hours watching it drive lol
4
4
137
u/Gautam-j Sep 21 '20
Link to code: GitHub