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
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ 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-1.9.0-cp27-none-linux_x86_64.whl
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.14.0-cp27-none-linux_x86_64.whl
pip install --ignore-installed --upgrade $TF_BINARY_URL
elif [ $value = "Darwin" ]
then
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
six
requests==2.20.0
Pillow==4.1.1
tensorflow>=1.14.0
requests>=2.22.0
Pillow>=6.0.0
BeautifulSoup4>=4.6.0
-e .
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

setup(
name='tensorpy',
version='1.3.1',
version='1.4.0',
description='Easy Image Classification with TensorFlow!',
long_description=long_description,
long_description_content_type='text/markdown',
Expand All @@ -30,8 +30,9 @@
license="MIT",
install_requires=[
'six',
'requests==2.20.0',
'Pillow==4.1.1',
'tensorflow>=1.14.0',
'requests>=2.22.0',
'Pillow>=6.0.0',
'BeautifulSoup4>=4.6.0',
],
packages=['tensorpy'],
Expand Down
4 changes: 2 additions & 2 deletions tensorpy/classify_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
FLAGS = tf.app.flags.FLAGS
tf.logging.set_verbosity(tf.logging.ERROR)
tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR)
tf.app.flags.DEFINE_string(
'model_dir', settings.IMAGENET_FOLDER,
"""Path to classify_image_graph_def.pb, """
Expand Down Expand Up @@ -126,4 +126,4 @@ def external_run(image):


if __name__ == '__main__':
tf.app.run()
tf.compat.v1.app.run()
2 changes: 1 addition & 1 deletion tensorpy/download_imagenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ def main(_):
maybe_download_and_extract()


tf.app.run()
tf.compat.v1.app.run()
4 changes: 2 additions & 2 deletions tensorpy/image_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ def convert_image_file_to_jpg(file_name):
outfile = f + ".jpg"
if infile != outfile:
try:
Image.open(infile).convert('RGBA').save(outfile, "JPEG")
Image.open(infile).convert('RGB').save(outfile, "JPEG")
except IOError:
raise Exception("Cannot convert %s to jpg!" % file_name)


def load_image_from_url(image_url):
response = requests.get(image_url)
image = Image.open(StringIO(response.content)).convert('RGBA')
image = Image.open(StringIO(response.content)).convert('RGB')
return image


Expand Down