Skip to content

Object Detection using Flask, TensorFlow Serving and Docker. Implements a web app to which images can be uploaded. A TensorFlow model is then used to perform object detection. The model is served through TensorFlow Serving. The web app and the TF-Serving server is packaged using Docker. Docker-compose is used to create a virtual network for both…

License

Notifications You must be signed in to change notification settings

lucasfbn/ObjectDetection_TFServing_Docker_Flask

Repository files navigation

Object Detection using Flask, TensorFlow Serving and Docker

Implements a web app to which images can be uploaded. A TensorFlow model is then used to perform object detection. The model is served through TensorFlow Serving. The web app and the TF-Serving server is packaged using Docker. Docker-compose is used to create a virtual network for both container such that the Flask app can access the TF Serving container (in this case via REST).

Directory structure:

  • root
    • .env
      • Defines several environment variables that are used within the docker-compose file and the web app
    • docker-compose.yml
      • Defines the services (Flask web app + TF Serving) such that they are run together. Utilises the GPU (prerequisites).
    • docker-compose_CPU.yml
      • Same as the file above but doesn't utilise the GPU (and, therefore, also doesn't require any extra prerequisites).
  • flask_app
    • Contains the Flask web app along with the respective Dockerfile.
  • models

Run

To run the entire app, type (in the same directory as this README file):

sudo docker-compose up

Wait a few seconds until both containers are spun up. Then visit localhost:8500 to view the app.

To use the app select a valid image (.jpg, .jpeg, .png) and hit "Submit". The result will be displayed within a few seconds.

Screenshot

About

Object Detection using Flask, TensorFlow Serving and Docker. Implements a web app to which images can be uploaded. A TensorFlow model is then used to perform object detection. The model is served through TensorFlow Serving. The web app and the TF-Serving server is packaged using Docker. Docker-compose is used to create a virtual network for both…

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published