enpit / tensorflow-for-lego

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About


Languages

Language:Python 99.4%Language:Shell 0.6%