Skip to content

ywng/flask-dl-api

Repository files navigation

Prerequisites

You'll need the following:

Run the app locally

Install the dependencies listed in the requirements.txt file to be able to run the app locally.

You can optionally use a virtual environment to avoid having these dependencies clash with those of other Python projects or your operating system.

pip install -r requirements.txt

Run the app.

python api.py

View your app at: http://localhost:8000

Prepare the app for deployment

To deploy to IBM Cloud, it can be helpful to set up a manifest.yml file.

The manifest.yml includes basic information about your app, such as the name, how much memory to allocate for each instance and the route. In this manifest.yml random-route: true generates a random route for your app to prevent your route from colliding with others. You can replace random-route: true with host: myChosenHostName, supplying a host name of your choice. Learn more...

Deploy the app

You can use the Cloud Foundry CLI to deploy apps.

Choose your API endpoint

cf api <API-endpoint>

Replace the API-endpoint in the command with an API endpoint from the following list.

URL Region
https://api.ng.bluemix.net US South
https://api.eu-de.bluemix.net Germany
https://api.eu-gb.bluemix.net United Kingdom
https://api.au-syd.bluemix.net Sydney

Login to your IBM Cloud account

cf login

From within the project root directory push your app to IBM Cloud

cf push

This can take a minute. If there is an error in the deployment process you can use the command cf logs <Your-App-Name> --recent to troubleshoot.

When deployment completes you should see a message indicating that your app is running. View your app at the URL listed in the output of the push command. You can also issue the

cf apps

command to view your apps status and see the URL.

About

Serving trained deep learning models in Flask

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 13