Code Monkey home page Code Monkey logo

ourcamera's Introduction

OurCamera

Read About Project Here

This project uses Google's TensorFlow Machine learning package to identify and categorize types of vehicles on NYC streets.

The data images are downloaded from NYC DOT cameras.

The training data folder has a series of images and training annotations.

Setup

Run

Create a test.record file and a train.record file:

./generate_tfrecord --folder=path/to/data_dir --train_ratio=.70

Download COCO-pretrained Faster R-CNN with Resnet-101 model Unzip model in the data/models/ folder

Your data structure should look like

data/test.record data/train.record models/model/faster_rcnn_resnet101_coco_11_06_2017 models/model/train models/model/eval

In three seperate command line windows run:

export PYTHONPATH=$PYTHONPATH:pwd:pwd/slim

python models-master/research/object_detection/train.py     --logtostderr    
    --pipeline_config_path=./data/faster_rcnn_resnet101_cars.config  
    --train_dir=./data/models/model/train
python models-master/research/object_detection/eval.py     --logtostderr    
    --pipeline_config_path=./data/faster_rcnn_resnet101_cars.config    
    --checkpoint_dir=./data/models/model/train     
    --eval_dir=./data/models/model/eval
tensorboard --logdir=./data/models/model/

After a thousand or so steps you should be getting results. Look at your tensorflow eval images to gauge when to stop. FYI it took my 4770k Intel i7 about 24 hours to train.

Create a frozen version of your graph by selecting a checkpoint:

python object_detection/export_inference_graph.py \
    --input_type image_tensor \
    --pipeline_config_path /path/data/models/faster_rcnn_resnet101_cars.config \
    --trained_checkpoint_prefix /path/data/models/model/train/model.ckpt-18557 \
    --output_directory output_inference_graph.pb

Run saveimages.py to create a folder of images. This will save an image every second so leave it open as long as you want.

Analyze the images

analyzeimages \
        -path_images ./data/rawimages/ 
        -path_labels_map data/car_label_map.pbtxt 
        -save_directory data/processedimages/

Alt text

Gotchas:

  • When you start up an Amazon EC2 Instance using the AWS Deep Learning AMI you have to enable tensorflow

ourcamera's People

Contributors

bellspringsteen avatar loisaidasam avatar

Watchers

Dave Mee avatar James Cloos 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.