Skip to content

alvarobartt/tensorflow-serving-streamlit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TensorFlow Serving + Streamlit! ✨🖼️

Serve TensorFlow ML models with TF-Serving and then create a Streamlit UI to use them!

This is a pretty simple Streamlit UI to expose the functionality of a TensorFlow image classification CNN served using TensorFlow Serving.

In this case, we will be serving the ML model developed at alvarobartt/serving-tensorflow-models, which is an image classification CNN to classify images from The Simpsons Characters.


📺 Demo


🐋 Deployment

In order to deploy the presented application, you will need to use Docker Compose, which means that you will also need to have Docker installed.

We will deploy the following Docker Containers:

  • src/tfserving: contains the TF-Serving API deployment.
  • src/streamlit: contains the code of the UI connected to the deployed API.

That said, you can easily deploy them with Docker Compose. So we will start off with the initial step which is building the containers, with the following command:

docker-compose build --force-rm

Note: we use --force-rm so as to force the removal of the intermediate Docker containers.

Once built, we can proceed to deploy the containers with the following command:

docker-compose up

Finally, whenever you want to stop the containers you can use the following command:

docker-compose stop

And additionally, you can also remove the containers once you don't need them anymore with the following command:

docker-compose rm