GithubHelp home page GithubHelp logo

flask_demo_with_inceptions_on_coco's Introduction


Flask And TensorFlow Serving using Docker

The project is a Flask backend serving objection detection apis provided from TensorFlow serving. Both are deployed using Docker. A live demo can be found at DigitalOcean.


Project Overview

Flask And Tensorflow Serving using Docker is using Flask as backend server, PostgreSQL as database, TensorFlow Serving as image detection service.

The project is replying on SQLAlchemy and Flask-Migrate to manage database tables.

Flask-Uploads and Flask-Dropzone are used for handling image uploads. Flask-Uploads mainly manages image datastore while Flask-Dropzone handling frontend js.

Flask-Login is for user registration, login and logout, and api authorizations. Currently functions like email confirmations are not implemented in this demo.

The model used for this demo can be found in this Github Repository Model Zoo, which is ssd_inception_v2_coco.

For any other models in the model zoo repository or your own trained ones, change the build args in launch.sh, like docker-compose build --build-arg model_url="http://download.tensorflow.org/models/object_detection/ssd_inception_v2_coco_2018_01_28.tar.gz"

Prerequisite

Running Directly

For running demo without Docker, you need Python 3.6 or later and PostgreSQL database set up accordingly. To setup Tensorflow Serving, you can find more details at this Medium post.

Install dependencies listed in the requirements by pip install -r requirements.txt. Inside the app folder, execute Flask db upgrade and Flask run or python run.py. After defining environment variables needed for configuration, you should be able to see a Flask instance up and running.

Running using Docker

If you are running demo with Docker (recommended), you can clone this project and do the following:

$ cd Flask_Demo_with_Inceptions_on_COCO/
$ sh launch.sh

In another terminal tab, initialize database on the first time:

$ cd Flask_Demo_with_Inceptions_on_COCO/
$ sh init_db.sh

Another note: Please change demo > pg > configuration.py UPLOADS_DEFAULT_URL = 'http://<your ip address>:5000/static/img/'. Ex. On you local machine, replace the ip address with localhost. Same for UPLOADED_PHOTOS_URL.

Contact

If you have any questions, feel free to raise an issue. Good luck!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.