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
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@

(**[Watch the 2-minute tutorial on YouTube](https://www.youtube.com/watch?v=lVtzaHcUE7Q)**)

(**Upgraded** since that video was released!)
### Requirements:

* <b>A Mac or Linux machine</b>
* <b>Python 3.5, 3.6, or 3.7</b>

You can use TensorPy to classify images by simply passing a URL on the command line, or by using TensorPy in your Python programs. **[TensorFlow](https://www.tensorflow.org/)** does all the real work. TensorPy also simplifies TensorFlow installation by automating several setup steps into a single script (See **[install.sh](https://github.com/TensorPy/TensorPy/blob/master/install.sh)** for details).

Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
six
tensorflow==1.14.0
requests>=2.22.0
Pillow>=6.1.0
tensorflow==1.15.4
six>=1.11.0
requests>=2.18.4
Pillow==5.4.1
BeautifulSoup4>=4.6.0
52 changes: 44 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,50 @@
"""

from setuptools import setup, find_packages # noqa
from os import path
import os
import sys


this_directory = path.abspath(path.dirname(__file__))
this_directory = os.path.abspath(os.path.dirname(__file__))
long_description = None
try:
with open(path.join(this_directory, 'README.md'), 'rb') as f:
with open(os.path.join(this_directory, 'README.md'), 'rb') as f:
long_description = f.read().decode('utf-8')
except IOError:
long_description = 'Easy Image Classification with TensorFlow!'

if sys.argv[-1] == 'publish':
reply = None
input_method = input
if not sys.version_info[0] >= 3:
input_method = raw_input # noqa
reply = str(input_method(
'>>> Confirm release PUBLISH to PyPI? (yes/no): ')).lower().strip()
if reply == 'yes':
print("\n*** Checking code health with flake8:\n")
flake8_status = os.system("flake8 --exclude=temp")
if flake8_status != 0:
print("\nWARNING! Fix flake8 issues before publishing to PyPI!\n")
sys.exit()
else:
print("*** No flake8 issues detected. Continuing...")
print("\n*** Rebuilding distribution packages: ***\n")
os.system('rm -f dist/*.egg; rm -f dist/*.tar.gz; rm -f dist/*.whl')
os.system('python setup.py sdist bdist_wheel') # Create new tar/wheel
print("\n*** Installing twine: *** (Required for PyPI uploads)\n")
os.system("python -m pip install --upgrade 'twine>=1.15.0'")
print("\n*** Installing tqdm: *** (Required for PyPI uploads)\n")
os.system("python -m pip install --upgrade 'tqdm>=4.49.0'")
print("\n*** Publishing The Release to PyPI: ***\n")
os.system('python -m twine upload dist/*') # Requires ~/.pypirc Keys
print("\n*** The Release was PUBLISHED SUCCESSFULLY to PyPI! :) ***\n")
else:
print("\n>>> The Release was NOT PUBLISHED to PyPI! <<<\n")
sys.exit()

setup(
name='tensorpy',
version='1.4.2',
version='1.5.0',
description='Easy Image Classification with TensorFlow!',
long_description=long_description,
long_description_content_type='text/markdown',
Expand All @@ -28,11 +58,17 @@
author_email='mdmintz@gmail.com',
maintainer='Michael Mintz',
license="MIT",
classifiers=[
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
],
python_requires='>=3.5, <3.8',
install_requires=[
'six',
'tensorflow==1.14.0',
'requests>=2.22.0',
'Pillow>=6.1.0',
'tensorflow==1.15.4',
'six>=1.11.0',
'requests>=2.18.4',
'Pillow==5.4.1',
'BeautifulSoup4>=4.6.0',
],
packages=['tensorpy'],
Expand Down
1 change: 1 addition & 0 deletions tensorpy/download_imagenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def maybe_download_and_extract():
os.makedirs(dest_directory)
filename = DATA_URL.split('/')[-1]
filepath = os.path.join(dest_directory, filename)
print("ImageNet Inception DB filepath: %s" % filepath)
if not os.path.exists(filepath):
def _progress(count, block_size, total_size):
sys.stdout.write('\r>> Downloading %s %.1f%%' % (
Expand Down