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
49 changes: 20 additions & 29 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,55 +1,46 @@
# TensorPy Docker Image
FROM ubuntu:15.10
FROM ubuntu:17.10

#=======================================
# Install Python and Basic Python Tools
#=======================================
RUN apt-get update && apt-get install -y python python-pip python-setuptools \
python-dev python-distribute python-virtualenv
#================================
# Update apt-get package sources
#================================
RUN apt-get update

#=========================================
# Install Bash Command Line Tools and Git
#=========================================
#==================================================
# Install Bash Command Line Tools, Python, and Git
#==================================================
RUN apt-get -qy --no-install-recommends install \
python \
python-dev \
python-pip \
python-distribute \
python-virtualenv \
python-setuptools \
sudo \
unzip \
wget \
curl \
libxi6 \
libgconf-2-4 \
vim \
git-core \
&& rm -rf /var/lib/apt/lists/*

#========================================
# Add normal user with passwordless sudo
#========================================
RUN sudo useradd seluser --shell /bin/bash --create-home \
&& sudo usermod -a -G sudo seluser \
&& echo 'ALL ALL = (ALL) NOPASSWD: ALL' >> /etc/sudoers

#==============================
# Locale and encoding settings
#==============================
ENV LANGUAGE en_US.UTF-8
ENV LANG ${LANGUAGE}
RUN locale-gen ${LANGUAGE} \
&& dpkg-reconfigure --frontend noninteractive locales

#==============================
# Set up TensorFlow / TensorPy
#==============================
COPY third_party/docker/docker_install.sh /TensorPy/docker_install.sh
COPY install.sh /TensorPy/install.sh
COPY requirements.txt /TensorPy/
COPY setup.py /TensorPy/
COPY tensorpy /TensorPy/tensorpy/
COPY examples /TensorPy/examples/
COPY third_party/docker /TensorPy/third_party/docker/
COPY third_party/docker/run_docker_test.sh /TensorPy/
RUN cd /TensorPy && ls && ./third_party/docker/docker_install.sh
COPY integrations/docker/run_docker_test.sh /TensorPy/
RUN cd /TensorPy && ls && ./install.sh
RUN cd /TensorPy && pip install -r requirements.txt

#===================
# Create entrypoint
#===================
COPY third_party/docker/docker-entrypoint.sh /
COPY integrations/docker/docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["/bin/bash"]
14 changes: 3 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@

(**Upgraded** since that video was released!)

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)** and **[python3_install.sh](https://github.com/TensorPy/TensorPy/blob/master/python3_install.sh)** for details).
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).

(Read **[how_tensorpy_works](https://github.com/TensorPy/TensorPy/blob/master/help_docs/how_tensorpy_works.md)** for a detailed explanation of how TensorPy works.)


## Setup Steps for Mac & Ubuntu/Linux

(**Windows & Docker users**: See the **[Docker ReadMe](https://github.com/TensorPy/TensorPy/blob/master/third_party/docker/ReadMe.md)** for running on a Docker machine. Windows requires Docker to run TensorFlow.)
(**Windows & Docker users**: See the **[Docker ReadMe](https://github.com/TensorPy/TensorPy/blob/master/integrations/docker/ReadMe.md)** for running on a Docker machine. Windows requires Docker to run TensorFlow.)

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

Expand All @@ -33,18 +33,12 @@ cd TensorPy

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

For **Python 2.7** users, use **[install.sh](https://github.com/TensorPy/TensorPy/blob/master/install.sh)** to install everything you need.
Use **[install.sh](https://github.com/TensorPy/TensorPy/blob/master/install.sh)** to install everything you need.

```bash
./install.sh
```

For **Python 3** users, use **[python3_install.sh](https://github.com/TensorPy/TensorPy/blob/master/python3_install.sh)** to install everything you need.

```bash
./python3_install.sh
```

#### **Step 4:** Run the examples

(NOTE: Run times may vary depending on your Internet connection and computer's CPU speed.)
Expand Down Expand Up @@ -81,8 +75,6 @@ classify examples/images/

#### **Examples in Python programs:**

*(**NOTE**: If you're using Python 3 instead of Python 2.7, replace "``python``" with "``python3``" on the command line.)*

Classify an image from a local file path using a Python script: (See **[test_python_file_classify.py](https://github.com/TensorPy/TensorPy/blob/master/examples/test_python_file_classify.py)** for details.)

```bash
Expand Down
10 changes: 8 additions & 2 deletions help_docs/pip_installation.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
### Pip Installation Instructions

Ubuntu/Linux
Ubuntu/Linux:

```bash
sudo apt-get install python-pip python-dev
```

Mac OS X
Mac OS X:

```bash
sudo easy_install pip
```

OR

```bash
python -m pip install -U pip
```
9 changes: 4 additions & 5 deletions help_docs/virtualenv_instructions.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
### Virtual Environment Setup Tutorial

First:
First, install virtualenv / virtualenvwrapper:

```bash
sudo pip install virtualenv
sudo pip install virtualenvwrapper
python -m pip install virtualenv
python -m pip install virtualenvwrapper
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
```

Next, follow the command depending on the system you're using:
If you add ``source /usr/local/bin/virtualenvwrapper.sh`` to your local bash file (``~/.bash_profile`` on Mac, ``~/.bashrc`` on Linux), virtualenvwrapper commands will be available to you whenever you open a new command prompt. You can then use the following commands to make those changes active.

Mac users: ``source ~/.bash_profile``
Linux users: ``source ~/.bashrc``
Expand All @@ -28,7 +28,6 @@ deactivate

You can always jump back in later:

(If you're using ``virtualenvwrapper``):
```bash
workon tensorpy
```
14 changes: 6 additions & 8 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
# Installs TensorPy, TensorFlow, ImageNet, and required dependancies
# (Made for Python 2.7)

pip install --upgrade pip
echo "Installing TensorPy for Python 2.7:"
python -m pip install --upgrade pip
echo "Installing TensorPy:"
pip install -r requirements.txt --upgrade
python setup.py develop
value="$(uname)"
if [ $value == "Linux" ]
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.2.1-cp27-none-linux_x86_64.whl
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.9.0-cp27-none-linux_x86_64.whl
pip install --ignore-installed --upgrade $TF_BINARY_URL
elif [ $value == "Darwin" ]
elif [ $value = "Darwin" ]
then
echo "Initializing TensorFlow setup on a MAC..."
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.2.1-py2-none-any.whl
pip install --ignore-installed --upgrade $TF_BINARY_URL
pip install --upgrade tensorflow
else
echo "Incompatible machine for TensorFlow. Exiting script..."
fi
Expand Down
2 changes: 1 addition & 1 deletion third_party/ReadMe.md → integrations/ReadMe.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## Third-Party / Integrations
## Integrations

This folder contains TensorPy integrations
File renamed without changes.
12 changes: 0 additions & 12 deletions python3_install.sh

This file was deleted.

4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
requests==2.18.1
six==1.10.0
requests==2.19.1
six==1.11.0
Pillow==4.1.1
BeautifulSoup4==4.6.0
-e .
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@

setup(
name='tensorpy',
version='1.1.0',
version='1.2.0',
url='http://tensorpy.com',
author='Michael Mintz',
author_email='mdmintz@gmail.com',
maintainer='Michael Mintz',
description='Easy Image Classification with TensorFlow!',
license='The MIT License',
install_requires=[
'requests==2.18.1',
'six==1.10.0',
'requests==2.19.1',
'six==1.11.0',
'Pillow==4.1.1',
'BeautifulSoup4==4.6.0',
],
Expand Down
12 changes: 0 additions & 12 deletions third_party/docker/docker_install.sh

This file was deleted.