Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ value="$(uname)"
if [ $value == "Linux" ]
then
echo "Initializing TensorFlow setup on a Linux machine..."
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.12.0rc1-cp27-none-linux_x86_64.whl
pip install $TF_BINARY_URL
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.0-cp34-cp34m-linux_x86_64.whl
pip install --ignore-installed --upgrade $TF_BINARY_URL
elif [ $value == "Darwin" ]
then
echo "Initializing TensorFlow setup on a MAC..."
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0rc1-py2-none-any.whl
pip install $TF_BINARY_URL
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.0.0-py2-none-any.whl
pip install --ignore-installed --upgrade $TF_BINARY_URL
else
echo "Incompatible machine for TensorFlow. Exiting script..."
fi
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name='tensorpy',
version='1.0.10',
version='1.0.11',
url='http://tensorpy.com',
author='Michael Mintz',
author_email='@mintzworld',
Expand Down
9 changes: 5 additions & 4 deletions tensorpy/classify_image.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
""" Simple image classification with Inception. """
# This is a modified version of the following file:
# https://github.com/tensorflow/tensorflow/blob/master/tensorflow/models/image/imagenet/classify_image.py # noqa
# https://github.com/tensorflow/models/blob/master/tutorials/image/imagenet/classify_image.py # noqa

from __future__ import absolute_import
from __future__ import division
Expand All @@ -11,7 +11,9 @@
from tensorpy import settings
import tensorflow as tf

os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
FLAGS = tf.app.flags.FLAGS
tf.logging.set_verbosity(tf.logging.ERROR)
tf.app.flags.DEFINE_string(
'model_dir', settings.IMAGENET_FOLDER,
"""Path to classify_image_graph_def.pb, """
Expand All @@ -21,7 +23,6 @@
"""Absolute path to image file.""")
tf.app.flags.DEFINE_integer('num_top_predictions', 1,
"""Display this many predictions.""")
external_run = False


class NodeLookup(object):
Expand Down Expand Up @@ -89,7 +90,7 @@ def create_graph():
_ = tf.import_graph_def(graph_def, name='') # noqa


def run_inference_on_image(image):
def run_inference_on_image(image, external_run=False):
if not tf.gfile.Exists(image):
tf.logging.fatal('File does not exist %s', image)
image_data = tf.gfile.FastGFile(image, 'rb').read()
Expand Down Expand Up @@ -120,7 +121,7 @@ def main(_):


def external_run(image):
best_guess = run_inference_on_image(image)
best_guess = run_inference_on_image(image, external_run=True)
return best_guess


Expand Down