Giter Club home page Giter Club logo

deep-learning-traffic-lights's Introduction

Recognizing Traffic Lights with Deep Learning

This repo contains the files used to train and run the classifier described in this blog post. This was done during a challenge by Nexar to recognize traffic lights based on images taken by their dashcam app.

Dependencies

Caffe with python bindings.

Directory contents:

/model: contain a caffe deploy.prototxt file and three weights files. The three weights files are used together in a model ensemble.

/testing: has jupyter notebook files that run the model and perform the weighted average.

/training: contains the files needed to train the model (except the training data)

Training the model

The images were first converted to lmdb format and resized to 256x256 using this command:

GLOG_logtostderr=1 ~/caffe/build/tools/convert_imageset \
    --resize_height=256 --resize_width=256 --shuffle  \
    ~/nexar/images/ \
    ~/nexar/labels_test.txt \
    ~/nexar/lmdb/test_lmdb

Each model has a directory in training with some or all of the following files:

solver.prototxt   caffe solver file
solver_p2.prototxt  caffe solver file with lower base learning rate
train_val.prototxt  network training file
rotation_layer.py   python caffe layer for data augmentation with rotation

squeeze_net_manual_scratch__os was training from scratch. The other two models were fine-tuning from weights trained on ImageNet. The weights file is named squeezenet_v1.0.caffemodel.

deep-learning-traffic-lights's People

Contributors

davidbrai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deep-learning-traffic-lights's Issues

Dataset

Great project. I'm trying to give it a go. Do you think you can make available the dataset?

I want to get the data

Hello,can you give me the data of the traffic light,I can not download the data from Nexar.

sliding_patch.ipynb

when I use sliding_patch.ipynb

from caffe.classifier import Classifier

model_def = "/home/zsx/deep-learning-traffic-lights-master/model/deploy.prototxt"
model_weights = "/home/zsx/deep-learning-traffic-lights-master/model/train_squeezenet_trainval_manual_p2__iter_3817.caffemodel"

c = Classifier(
model_def,
model_weights,
mean=np.array([104, 117, 123]),
raw_scale=255,
channel_swap=(2,1,0),
image_dims=(256, 256))

set batch size

BATCH_SIZE = 64
c.blobs['data'].reshape(BATCH_SIZE, 3, c.blobs['data'].shape[2], c.blobs['data'].shape[3])
c.blobs['prob'].reshape(BATCH_SIZE, 3)
c.reshape()

def class_idx_to_name(idx):
return ['none', 'red', 'green'][idx]

[I 21:58:49.510 NotebookApp] KernelRestarter: restarting kernel (1/5)
WARNING:root:kernel 09a50faf-6028-42f2-8e9b-3294050616e8 restarted
My ipython on the restart, which is why?

AttributeError: 'dict' object has no attribute 'itervalues'

hello, I use python3.5 to run test demo edited with notepad++, and it leads to the error "AttributeError: 'dict' object has no attribute 'itervalues'" as the following, how can i solve it? Your help will be greatly appreciated.
————————————————————————————————————————————
The error is fixed with changing my python path… you can close this Issue, thx.

About the Dataset

Hi David,
I'm very interested in your work, and I want to do some experiments about it too, but the Nexar Challenge #1 has been closed. Could you please send the challenge dataset to me. Thank you very much.

Asking for the Dataset

Hi. May I have the dataset of the NEXAR Challenge One? The challenge has been closed and I cannot download the dataset from the website. Thank you for your time.

how to use notebook in aws

Hello, I used AWS service. There is a problem, would like to ask you again

In my AWS use I used a P2 xlarge, this in my use, aws service staff told me that the use of ssh link to use AWS p2.

There is no way to use jupyter notebook. Do you use the desktop UI? How to use the browser-based jupyter notebook.

If you can be convenient, give me a little share

Whicth one should I use to Convert to CoreML.

I'm a new learner and want to build a traffic light recognizing app.I want to convert one of your model to CoreML type .But I have no idea which one should I use.
Please forgive my ignorance.Looking forward to your reply!

frame rate ?

Hi,

What is the processing time or frame rate of the final model?

Thanks,
Madhu.

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.