Skip to content

enpit/tensorflow-for-lego

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tensorflow for Lego object detection

Requirements

  • Tensorflow 1.2.1
  • ffmpeg 3.3.3 (Tested on macOS 10.12.6)

Prepare Training images

Create video of a specific brick, e.g. brick2x4.mov

Move to training-data/brick2x4

Create images (3 per second):

$ ffmpeg -i brick2x4.mov -vf fps=3 img%03d.jpg

Start training

$ ./learn.sh

Predict recognition

$ python label_image.py evaluation-data/eval2x2.png
brick2x2 (score = 0.67055)
brick2x3 (score = 0.28938)
brick2x4 (score = 0.03470)
brick1x2 (score = 0.00537)

Resources

$ curl -O https://raw.githubusercontent.com/tensorflow/tensorflow/r1.1/tensorflow/examples/image_retraining/retrain.py