User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
cs:vision:object_detection:start [2018/03/30 16:56]
James Irwin [Tensorflow Object Detection API]
cs:vision:object_detection:start [2018/03/31 18:16]
Mike Bykhovtsev Added instructions on how to convert trained data
Line 26: Line 26:
   print(sess.run(hello))   print(sess.run(hello))
  
-==== CPU Tensorflow ​Installation ====+==== CPU Installation ====
 If you're running on CPU only, you simply need to run:J If you're running on CPU only, you simply need to run:J
   pip install --user tensorflow   pip install --user tensorflow
  
-==== GPU Tensorflow ​Installation ====+==== GPU Installation ====
 If you're running on an Nvidia GPU, you'll need to install Nvidia'​s CUDA and CuDNN libraries. Currently, Tensorflow requires CUDA 9.0 and CuDNN 7.0, it's important you install the right versions. To install tensorflow for gpu, run: If you're running on an Nvidia GPU, you'll need to install Nvidia'​s CUDA and CuDNN libraries. Currently, Tensorflow requires CUDA 9.0 and CuDNN 7.0, it's important you install the right versions. To install tensorflow for gpu, run:
  
Line 78: Line 78:
  
 After the data is labeled we can start training! After the data is labeled we can start training!
 +
 +====== Train Network ======
 +Instruction were adapted from [[https://​github.com/​tensorflow/​models/​blob/​master/​research/​object_detection/​g3doc/​running_locally.md | here]].
 +
 +===== Workspace Setup =====
 +Setup your workspace with the following directory structure:
 +  object_detection_workspace/​
 +  ├── data
 +  ├── models
 +  └── output
 +      ├── eval
 +      └── train
 +
 +data/ will hold your training data (label_map.pbtext,​ train.record,​ and test.record). output/ and its subdirectories hold the outputs of the training and evaluation programs. models/ will store the various network architectures you're experimenting with (you might just have one model).
 +
 +===== Getting a Model =====
 +Instructions were adapted from [[https://​github.com/​tensorflow/​models/​blob/​master/​research/​object_detection/​g3doc/​configuring_jobs.md | here]].
 +One of the advantages of using TFODA is that it is really easy to try different network architectures (models) and seeing their speed vs. accuracy tradeoffs. To get a model 
 +===== Exporting a trained model for inference =====
 +To export checkpoint trained data for ''​%%robosub_object_detection%%''​ format you need to follow [[https://​github.com/​tensorflow/​models/​blob/​master/​research/​object_detection/​g3doc/​exporting_models.md|these]] instructions. Or run this:
 +  python object_detection/​export_inference_graph.py \
 +      --input_type image_tensor \
 +      --pipeline_config_path ${PIPELINE_CONFIG_PATH} \
 +      --trained_checkpoint_prefix ${TRAIN_PATH} \
 +      --output_directory output_inference_graph.pb
 +
 +