• Stars
    star
    174
  • Rank 219,104 (Top 5 %)
  • Language
    Python
  • License
    MIT License
  • Created over 4 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Bird-eye's view for CARLA simulator

Bird-eye's view for CARLA

Freeway-oriented shape Learning By Cheating-like shape Centerlines layer
cruising square-cruising centerlines

(GIFs above present feature maps after applying as_rgb() function)

Motivation

During our research we found a very inspiring paper called Learning By Cheating. Bird-eye's view is made specifically to learn faster thanks to much simpler, 2D world representation (cheating oracle) which we think fits well in Reinforcement Learning setup.

This repository is an almost complete reimplementation that gives better performance and compatibility with most recent versions of CARLA. You can use it out-of-the-box as input for your model, and if necessary convert and visualize into RGB.

Features

  • one-hot 3D feature map (8x2D layers, each representing other entities, e.g. road layer, pedestrians layer) - made specifically to feed your CNN
  • feature map can be converted to an RGB image
  • layers can be easily removed
  • caching mechanism for static layers like: roads and lanes
  • using OpenCV rendering (efficient, multi-threading friendly) instead of slow Pygame method
  • huge FPS speedup thanks to restricted rendering (only agent's surroundings, not whole map)
  • all CARLA maps are supported out-of-the-box, custom maps with valid OpenDrive file made in RoadRunner are also supported
  • current implementation is specifically adjusted for highway scenarios (prolonged shape), but other shapes and crops are easy to implement

Installation

pip install carla-birdeye-view

How to run

Make sure that PYTHONPATH env variable contains CARLA distribution egg, so that carla package can be imported.

# Launch server instance
./CarlaUE4.sh

# (optional) For CARLA 0.9.8+ you may get additional performance improvement with this
python PythonAPI/util/config.py --no-rendering

# Preview while cruising on autopilot (birdview/__main__.py)
python -m carla_birdeye_view

Basic code usage

from carla_birdeye_view import BirdViewProducer, BirdViewCropType, PixelDimensions

birdview_producer = BirdViewProducer(
    client,  # carla.Client
    target_size=PixelDimensions(width=150, height=336),
    pixels_per_meter=4,
    crop_type=BirdViewCropType.FRONT_AND_REAR_AREA
)

# Input for your model - call it every simulation step
# returned result is np.ndarray with ones and zeros of shape (8, height, width)
birdview = birdview_producer.produce(
    agent_vehicle=agent  # carla.Actor (spawned vehicle)
)

# Use only if you want to visualize
# produces np.ndarray of shape (height, width, 3)
rgb = BirdViewProducer.as_rgb(birdview)

Contribution and feedback

We'd โค๏ธ to collct any feedback, issues and pull requests!

Credits

Project born at deepsense.ai, made by:

Michaล‚ Martyniak (@micmarty)

More Repositories

1

roi-pooling

C++
460
star
2

db-ally

Efficient, consistent and secure library for querying structured data with natural language
Python
115
star
3

seahorse

Scala
104
star
4

carla-real-traffic-scenarios

Python
73
star
5

Distributed-BA3C

Python
56
star
6

pydatawarsaw-notebooks

CSS
55
star
7

edge-slm

This project is a native implementation of a RAG pipeline for Small Language Models tested on Android devices. The main goal was to fit the whole RAG pipeline into a resource constrained device - ie. smartphone. By design the provided RAG library should be deployable on various platforms.
C++
50
star
8

Keras-PyTorch-AvP-transfer-learning

We pit Keras and PyTorch against each other, showing their strengths and weaknesses in action. We present a real problem, a matter of life-and-death: distinguishing Aliens from Predators!
Jupyter Notebook
48
star
9

ds-splat

Cuda
42
star
10

seahorse-workflow-executor

Scala
41
star
11

tensorflow_on_slurm

Python
40
star
12

unblackboxing_webinar

Jupyter Notebook
28
star
13

ds-template

Template for professional data science and python applications made by deepsense.ai
Python
27
star
14

intel-ai-webinar-neural-networks

Jupyter Notebook
15
star
15

deep_learning_art_webinar

Jupyter Notebook
10
star
16

BA3C-CPU

C++
8
star
17

ds-pycontain

Library to run python REPL in isolated docker container and helpful abstraction for docker containers/images. in python
Python
7
star
18

ragbits

Building blocks for rapid development of GenAI applications
Python
6
star
19

hands-on-deep-learning

Jupyter Notebook
6
star
20

seahorse-sdk-example

Examples of usage of Seahorse SDK
Scala
4
star
21

trelbert

Repository for TrelBERT: A pre-trained encoder for Polish Twitter
3
star
22

mrunner

Python
2
star
23

hackathon_gov_pl

Repository for hackathon.gov.pl.
Jupyter Notebook
2
star
24

neptune-r-client-library

R
1
star