Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Commit

Permalink
Add TF serving README.
Browse files Browse the repository at this point in the history
  • Loading branch information
clennan committed Nov 27, 2018
1 parent 5fb4522 commit 97576e3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions contrib/tf_serving/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## Serving NIMA with TensorFlow Serving
TensorFlow versions of both the technical and aesthetic MobileNet models are provided,
along with the script to generate them from the original Keras files, under the `contrib/tf_serving` directory.

There is also an already configured TFS `Dockerfile` that you can use.

To get predictions from the aesthetic or technical model:
1. Build the NIMA TFS Docker image `docker build -t tfs_nima contrib/tf_serving`
2. Run a NIMA TFS container with `docker run -d --name tfs_nima -p 8500:8500 tfs_nima`
3. Install python dependencies to run TF serving sample client
```
virtualenv -p python3 contrib/tf_serving/venv_tfs_nima
source contrib/tf_serving/venv_tfs_nima/bin/activate
pip install -r contrib/tf_serving/requirements.txt
```
4. Get predictions from aesthetic or technical model by running the sample client
```
python -m contrib.tf_serving.tfs_sample_client --image-path src/tests/test_images/42039.jpg --model-name mobilenet_aesthetic
python -m contrib.tf_serving.tfs_sample_client --image-path src/tests/test_images/42039.jpg --model-name mobilenet_technical
```

0 comments on commit 97576e3

Please sign in to comment.