Giter VIP home page Giter VIP logo

traffic_light_detection's Introduction

Traffic Light Detection

Objectives

  • Detect traffict lights from traffic iamges (videos)
  • Classify the lights into 3 colors
  • This is used for self driving car

Approach

  • Use transfer learning of pre-trained model
  • Atchitecture
    • Use pretrained Mobile Net (CNN) for quick and memory saving detection, since speed is reauired. Mobile Net is trained for modification for this task
    • Use SSD (Single Shot Detection) to detect the location and the classification at the same time
    • SSD_Mobilenet 11.6.17 version from Tensorflow model zoo
  • Training Data: Used Bosch Small Traffic Light dataset (already annoted the class and positions) https://github.com/bosch-ros-pkg/bstld

Result

  • See video above
  • Detected red lights well, but still some missing lights
  • Detecting other color lights not tested

Setup (for Windows 10)

  • Download Bosch dataset and convert that into tfrecords format

  • Setup the transfer learning (Following comes from comes from repo of Alex Lechner's repo . Appreciate the describing the complex Tensorflow (of an older version of TF that has limited info.) setup!)

  • Install Tensorflor 1.4: pip install tensorflow==1.4 (newer version is not compatible!)

    • (for Linux machine with GPU, pip install tensorflow-gpu==1.4)
  • Install relevant packages: pip install pillow lxml matplotlib

  • Download protoc-3.4.0-win32.zip to extract to C:\Program Files\protoc-3.4.0-win32

    • (for Linux: sudo apt-get install protobuf-compiler python-pil python-lxml python-tk)
  • Create /TensorFlow directory

  • Clone Models repository into TensorFlow directory: git clone https://github.com/tensorflow/models.git

  • Navigate to the /models directory and change the repo version to: git checkout f7e99c0

  • Navigate to research folder, and creating .py files by executing: "C:\Program Files\protoc-3.4.0-win32\bin\protoc.exe" object_detection/protos/*.proto --python_out=.

  • Add following paths to environment variable PYTHONPATH (you may need to restart the terminal to activate the env variables):

    • models
    • models/research
    • models/research/slim
    • models/research/object_detection
  • run: python builders/model_builder_test.py at /object_detection directory

  • configure a tensorflow config file and place in /config folder.

  • train the model: python train.py --logtostderr --train_dif=./models/train --pipeline_config_path=./config/<TFMODELCONFIG.config>

  • freeze the model: python export_inference_graph.py --input_type image_tensor --pipeline_config_path./config/ssd_mobilenet_c1-B.config --trained_checkpoint_prefix ./models/train/model.ckpt-2000 --output_directory models

Reference

Note

  • This repository is not fully updated, there maybe some parts that are not updated

traffic_light_detection's People

Contributors

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