Skip to main content

TensorPy

pypi Python version Join the chat at https://gitter.im/TensorPy/Lobby

Easy Image Classification with TensorFlow

TensorPy Tutorial

(Watch the 2-minute tutorial on YouTube)

Requirements:

  • A Mac or Linux machine
  • Python 3.5, 3.6, or 3.7

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 does all the real work. TensorPy also simplifies TensorFlow installation by automating several setup steps into a single script (See install.sh for details).

(Read how_tensorpy_works for a detailed explanation of how TensorPy works.)

Setup Steps for Mac & Ubuntu/Linux

(Windows & Docker users: See the Docker ReadMe for running on a Docker machine. Windows requires Docker to run TensorFlow.)

Step 1: Create and activate a virtual environment named "tensorpy"

If you're not sure how to create a virtual environment, follow these instructions to learn how.

Step 2: Clone the TensorPy repo from GitHub

git clone https://github.com/TensorPy/TensorPy.git
cd TensorPy

Step 3: Install TensorPy, TensorFlow, and ImageNet/Inception

Use install.sh to install everything you need.

./install.sh

Step 4: Run the examples

(NOTE: Run times may vary depending on your Internet connection and computer's CPU speed.)

Classify a single image from a URL:

classify "http://cdn2.hubspot.net/hubfs/100006/happy_animal.jpg"

Classify all images on a web page:

classify "https://github.com/TensorPy/TensorPy/tree/master/examples/images"

Classify a single image URL from a Python script: (See test_python_classify.py for details.)

python examples/test_python_classify.py

Classify an image from a local file path:

classify examples/images/cat_animal.jpg

Classify all images from a local folder:

classify examples/images/

Examples in Python programs:

Classify an image from a local file path using a Python script: (See test_python_file_classify.py for details.)

cd examples
python test_python_file_classify.py

Classify all images in a local folder using a Python script (Output = LIST): (See test_python_folder_classify.py for details.)

cd examples
python test_python_folder_classify.py

Classify all images in a local folder using a Python script (Output = DICTIONARY): (See test_python_folder_classify_dict.py for details.)

cd examples
python test_python_folder_classify_dict.py

Future Work:

Eventually, the headline will change from "Image Classification with TensorFlow made easy!" to "Machine Learning with TensorFlow made easy!" once I expand on TensorPy to make other features of TensorFlow easier too. Stay tuned for updates!

Metadata

Release files for tensorpy 1.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tensorpy 1.6.1
File Size Uploaded
tensorpy-1.6.1.tar.gz 10.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tensorpy 1.6.1
File Interpreter ABI Platform
tensorpy-1.6.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 22.5 kB

Release files / tensorpy-1.6.1.tar.gz

Download URL tensorpy-1.6.1.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
140aad3b42e1f729ec905cebdb14f73bc6ca3bb415c128c7dc41b7fda70c986b
BLAKE2b-256 checksum
How to use checksums
fb6597ed9375da1ac5c3a2d55fb193b29d762e3b4d9f49f374f897ca94e6369d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.0

Release files / tensorpy-1.6.1-py2.py3-none-any.whl

Download URL tensorpy-1.6.1-py2.py3-none-any.whl
Size 11.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
13ba1f99c4050b7405be9f98ffdd8b5438faa26047a0be9b7faccdcd8b0c400e
BLAKE2b-256 checksum
How to use checksums
5e93768931b3d4b931dacb9254ac2c6fe24fbdf7241b6d8c38a8d6cdd0a6807d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.0

Release history Release notifications | RSS feed

This release

1.6.1 This release

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.2

3 release files

1.4.1

3 release files

1.4.0

3 release files

1.3.1

3 release files

1.3.0

3 release files

1.2.0

3 release files

1.1.0

4 release files

1.0.18

3 release files

1.0.17

3 release files

1.0.16

3 release files

1.0.15

3 release files

1.0.12

2 release files

1.0.11

2 release files

1.0.10

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.1

2 release files

0.0.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page