Git Product home page Git Product logo

ntnu-reinforcement's Introduction

Keep a saft distance

Keep a safe distance from vehicles in front of you by using images.

Result

you can see the result video and PowerPoint at the GoogleDrive.

Requirements

install Unity LTS 2021.3.14f1
(install Unity > LTS 2021.3.14f1 not recommended)

install Python, Pytorch, CUDA, and Unity ML-agent from here

Run

git clone https://github.com/Ghostly0328/NTNU-Reinforcement    
cd FinalProject

Open RL_FinalProject folder from Unity, click the play button and enjoy.

What I did?

i created a scene in the Unity environment with the function to keep a safe distance from vehicles in front of you by using images.

the whole project is to take photos to get the current situation in front of me, Then use yolo for vehicle inspection to get the car's coordinates. ppo will only know the vehicle coordinates from yolo value (according to the image to get the coordinates are not the world coordinates), and then according to the coordinates to calculate whether to accelerate or decelerate.

PPO

  • Observation:
    • Current speed
    • Car position (The position is based on the x and y of the YOLO output)
  • Actions(Continuous):
    • Speed up (1 to 0)
    • Slow down (0 to -1)
  • Reward:
    • +0.005 if in the yellow box
    • -0.001 if not in the yellow box
    • -1 at car accident

Tips

  • The position of the vehicle I set on the picture of the red dot.
  • According to this paper, you can use the distance between the base of the vehicle and the bottom of the picture to calculate the actual distance length.
  • I have tried to give other things such as the area of the bound box but the effect is not good, when the vehicle is too far away will not be distinguished. The use of the car base marker not only improves the effect, but can also have the same effect if the vehicles are different in size or type.

ntnu-reinforcement's People

Contributors

ghostly0328 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.