Giter VIP home page Giter VIP logo

pgdrive's Introduction

PGDrive: an open-ended driving simulator with infinite scenes

build codecov Documentation GitHub license GitHub stars

[ ๐Ÿ“บ Website | ๐Ÿ— Github Repo | ๐Ÿ“œ Documentation | ๐ŸŽ“ Paper ]

Welcome to PGDrive! PGDrive is an driving simulator with many key features, including:

  • ๐ŸŽ Lightweight: Extremely easy to download, install and run in almost all platforms.
  • ๐Ÿ“ท Realistic: Accurate physics simulation and multiple sensory inputs.
  • ๐Ÿš€ Efficient: Up to 500 simulation step per second and easy to parallel.
  • ๐Ÿ—บ Open-ended: Support generating infinite scenes and configuring various traffic, vehicle, and environmental settings.

๐Ÿ›  Quick Start

Please install PGDrive via:

pip install pgdrive

If you wish to contribute to this project or make some modification, you can clone the latest version of PGDrive locally and install via:

git clone https://github.com/decisionforce/pgdrive.git
cd pgdrive
pip install -e .

You can verify the installation and efficiency of PGDrive via running:

python -m pgdrive.examples.profile_pgdrive

The above script is supposed to be runnable in all places. Note that please do not run the above command in the folder that has a sub-folder called ./pgdrive.

๐Ÿš• Examples

Please run the following line to drive the car in the environment manually with keyboard!

python -m pgdrive.examples.enjoy_manual

You can also enjoy a journey carrying out by our professional driver pretrained from reinforcement learning!

python -m pgdrive.examples.enjoy_expert

A fusion of expert and manual controller, where the expect will try to rescue the manually controlled vehicle from danger, can be experienced via:

python -m pgdrive.examples.enjoy_saver

To show the main feature, procedural generation, we provide a script to show BIG:

python -m pgdrive.examples.render_big

Note that the above three scripts can not be run in headless machine. Please refer to the installation guideline in documentation for more information.

Running the following line allows you to draw the generated maps:

python -m pgdrive.examples.draw_maps

To build the environment in python script, you can simply run:

import pgdrive  # Import this package to register the environment!
import gym

env = gym.make("PGDrive-v0", config=dict(use_render=True))
# env = pgdrive.PGDriveEnv(config=dict(environment_num=100))  # Or build environment from class
env.reset()
for i in range(1000):
    obs, reward, done, info = env.step(env.action_space.sample())  # Use random policy
    env.render()
    if done:
        env.reset()
env.close()

We also prepare a Colab which demonstrates some basic usage of PGDrive as follows: Open In Colab

๐Ÿ“ฆ Predefined environment sets

We also define several Gym environment names, so user can start training in the minimalist manner:

import gym
import pgdrive  # Register the environment
env = gym.make("PGDrive-v0")

The following table presents some predefined environment names.

ย  Gym Environment Name Random Seed Range Number of Maps Comments
PGDrive-test-v0 [0, 200) 200 Test set, not change for all experiments.
PGDrive-validation-v0 ย  ย  ย  ย  ย  ย  ย  ย  ย  [200, 1000) 800 Validation set.
PGDrive-v0 [1000, 1100) 100 Default training setting, for quick start.
PGDrive-10envs-v0 [1000, 1100) 10 Training environment with 10 maps.
PGDrive-1000envs-v0 [1000, 1100) 1000 Training environment with 1000 maps.
PGDrive-training0-v0 [3000, 4000) 1000 First set of 1000 environments.
PGDrive-training1-v0 [5000, 6000) 1000 Second set of 1000 environments.
PGDrive-training2-v0 [7000, 8000) 1000 Thirds set of 1000 environments.
... More map set can be added in response to the requests

๐Ÿซ Documentations

More information about PGDrive can be found in PGDrive Documentation. Besides, the training code of our paper can be found in this repo.

๐Ÿ“Ž Citation

If you find this work useful in your project, please consider to cite it through:

@article{li2020improving,
  title={Improving the Generalization of End-to-End Driving through Procedural Generation},
  author={Li, Quanyi and Peng, Zhenghao and Zhang, Qihang and Qiu, Cong and Liu, Chunxiao and Zhou, Bolei},
  journal={arXiv preprint arXiv:2012.13681},
  year={2020}
}

Codacy Badge GitHub contributors GitHub forks GitHub issues

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.