Skip to content

🎯 POST /predict endpoint for getting VGG16 feature embeddings

License

Notifications You must be signed in to change notification settings

rememberlenny/publicart-ml-endpoint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VGG 16 Feature Extractor

GPLv3 license

An endpoint for uploading images and getting back VGG16 image feature embeddings

Screen Shot 2019-09-21 at 4 45 18 PM


Docker Installation

Build the image

cd publicart-ml-endpoint
docker build -t keras_flask .
docker run -e MODEL_PATH=models/your_model.h5 -p 5000:5000

You can mount your model into the container.

docker run -e MODEL_PATH=/mnt/models/your_model.h5  -v volume-name:/mnt/models -p 5000:5000 keras_flask

Local Installation

Clone the repo

$ git clone https://github.com/rememberlenny/publicart-ml-endpoint.git

Install requirements

$ pip install -r requirements.txt

Make sure you have the following installed:

  • tensorflow
  • keras
  • flask
  • pillow
  • h5py
  • gevent
  • gunicorn

Run with Python

Python 2.7 or 3.5+ are supported and tested.

$ python app.py

Play

Open http://localhost:5000 and have fun. 😃


Deployment

Deploy

Run the app

Run the script and hide it in background with tmux or screen.

$ python app.py

You can also use gunicorn instead of gevent

$ gunicorn -b 127.0.0.1:5000 app:app

More deployment options, check here

Set up Nginx

To redirect the traffic to your local app. Configure your Nginx .conf file.

server {
    listen  80;

    client_max_body_size 20M;

    location / {
        proxy_pass http://127.0.0.1:5000;
    }
}

About

🎯 POST /predict endpoint for getting VGG16 feature embeddings

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published