Code Monkey home page Code Monkey logo

carla-simulator-cam's Introduction

carla-simulator-CAM

Application to test CNNs using Class Activation Mapping techniques in the Carla Simulator. The idea behind this project is to create an application to increase the transparency of the DL models in the autonomous driving context.

Features

The application is launched through the carla_CAM.py script and it launches all the background processes. The app will launch the simulator if it is not running already, will deploy traffic and start the Pygame-based interactive window when you can visualize the sensors selected and interact with them. The app will also manage the garbage collection and process termination if it is exited. It is possible to maintain the simulator running with the flag --keepsim in case you want to launch the app faster.

Mid execution selection

The app offers interactive ways to select different parameters of the visualization any time. To do so, the pygame execution window reads "events" that are the interactions between the keyboard and mouse (input periphera(ls in general). It is possible to catch the type of event registered and create an option menu. We can differentiate two types of inputs:

Keyboard inputs

  • Key SPACE: Pauses the simulation and displays the saliency mask obtained for the selected technique, if the technique is not selected it will not stop the simulation and tell the user to select a technique. If the simulation is already paused, it resumes it.
  • Key M: Stops the simulation and displays a menu to select the CAM technique. If it is pressed when the simulation is paused (showing the saliency mask), it will prompt the user the method menu again to select a different method and compare the resulting saliency masks.
  • Key N: Stops the simulation and displays a menu to select the CNN architecture.
  • Key T: Performs a forward pass in the model and returns the top 5 classes detected.
  • Key Q and ESCAPE: Stops the execution of the app and the simulator (unless the --keepsim flag has been used during launch).

Mouse inputs

  • With the simulation running: Allows the user to select the input sensor to visualize. The area of the sensor that you click will select the feed that provides the input image to evaluate.
  • With a menu displayed: Allows the user to click and select an item from the menu.

Compatible CNN architectures

  • ResNet
  • Alexnet
  • VGGnet
  • YOLOv5

Compatible CAM Techniques

Gradient Based Techniques

  • Grad-CAM
  • Grad-CAM++
  • XGrad-CAM
  • FullGrad

Gradient Based Techniques

  • Score-CAM
  • Ablation-CAM
  • Eigen-CAM

Notes

To test random imagenet images it is possible to use the next repository: https://github.com/EliSchwartz/imagenet-sample-images

References

This project would not be possible without the incredible work from:

carla-simulator-cam's People

Contributors

rocapiedra avatar

Stargazers

 avatar

Watchers

 avatar  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.