TensorFlow를 설치하여 Pepper의 이미지를 인식했습니다.
9910 단어 TensorFlowNAORomeoPepper
소개
설치
TensorFlow 설치
$ brew install bazel swig
$ sudo easy_install -U six
$ sudo easy_install -U numpy
$ sudo easy_install wheel
$ sudo easy_install ipython
$ git clone -b v0.6.0 --recurse-submodules https://github.com/tensorflow/tensorflow.git
$ cd tensorflow
$ ./configure
$ bazel build -c opt //tensorflow/tools/pip_package:build_pip_package
$ bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
$ sudo pip install /tmp/tensorflow_pkg/tensorflow-0.6.0-py2-none-any.whl
설치 후 동작 확인
$ python
Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 12:54:16)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> hello = tf.constant("Hello, TensorFlow!")
>>> sess = tf.Session()
I tensorflow/core/common_runtime/local_device.cc:40] Local device intra op parallelism threads: 4
I tensorflow/core/common_runtime/direct_session.cc:58] Direct session inter op parallelism threads: 4
>>> print(sess.run(hello))
Hello, TensorFlow!
>>> a = tf.constant(10)
>>> b = tf.constant(32)
>>> print(sess.run(a + b))
42
이미지 인식 시도
팬더 (샘플)
$ python classify_image.py
I tensorflow/core/common_runtime/local_device.cc:40] Local device intra op parallelism threads: 4
I tensorflow/core/common_runtime/direct_session.cc:58] Direct session inter op parallelism threads: 4
giant panda, panda, panda bear, coon bear, Ailuropoda melanoleuca (score = 0.89233)
indri, indris, Indri indri, Indri brevicaudatus (score = 0.00859)
lesser panda, red panda, panda, bear cat, cat bear, Ailurus fulgens (score = 0.00264)
custard apple (score = 0.00141)
earthstar (score = 0.00107)
Pepper 그 1
$ python classify_image.py --image_file pepper1ss.jpg
soap dispenser (score = 0.26181)
sewing machine (score = 0.08305)
digital clock (score = 0.07441)
hand blower, blow dryer, blow drier, hair dryer, hair drier (score = 0.04593)
piggy bank, penny bank (score = 0.02755)
Pepper 2
$ python classify_image.py --image_file pepper3s.jpg
switch, electric switch, electrical switch (score = 0.51433)
soap dispenser (score = 0.11694)
stopwatch, stop watch (score = 0.11000)
hook, claw (score = 0.02720)
corkscrew, bottle screw (score = 0.01832)
Pepper 3
$ python classify_image.py --image_file pepper4s.jpg
soap dispenser (score = 0.13773)
mask (score = 0.13569)
joystick (score = 0.09575)
piggy bank, penny bank (score = 0.07548)
pencil sharpener (score = 0.02219)
나오
$ python classify_image.py --image_file nao1s.jpg
toyshop (score = 0.09573)
knee pad (score = 0.04186)
digital watch (score = 0.04072)
pill bottle (score = 0.03983)
soap dispenser (score = 0.02415)
Romeo
$ python classify_image.py --image_file romeo2.jpg
breastplate, aegis, egis (score = 0.25803)
knee pad (score = 0.08682)
toyshop (score = 0.07168)
comic book (score = 0.06568)
cuirass (score = 0.04174)
Pepper 4
$ python classify_image.py --image_file pepper-07s.jpg
bell pepper (score = 0.98801)
pencil sharpener (score = 0.00038)
cucumber, cuke (score = 0.00017)
stove (score = 0.00017)
Granny Smith (score = 0.00016)
이것은 굉장하다.
감상
Reference
이 문제에 관하여(TensorFlow를 설치하여 Pepper의 이미지를 인식했습니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/Suna/items/71cd8f78be4b23e43489텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)