An open API service indexing awesome lists of open source software.

https://github.com/chen0040/keras-image-classifier-web-api

Keras image classifier provided as web api
https://github.com/chen0040/keras-image-classifier-web-api

flask image-classifier keras keras-image-classifier ml-web multi train-classifier

Last synced: 22 days ago
JSON representation

Keras image classifier provided as web api

Awesome Lists containing this project

README

          

# keras-image-classifier-web-api

This provides keras DCNN-based image classifiers codes with flask as the web api server for the image classifiers.

# Usage

Run the following command to install the keras, flask and other dependency modules:

```bash
sudo pip install -r requirements.txt
```

## Training (Optional)

As the trained models are already included in the [demo/models](demo/models) folder in the project, the training is
not required. However, if you like to tune the parameters and retrain the models, you can use the
following command to run the training:

```bash
cd demo
python cnn_cifar10_train.py
```

The above commands will train dcnn model on the cifar10 dataset
dataset and store the trained model in [demo/models/cnn_cifar10_**](demo/models)

If you like to train other models, you can use the same command above on another train python scripts:

* cnn_bi_classifier.py: a simple cnn bi-class classifier trained using data in the [demo/bi-classifier_data](demo/bi_classifier_data) folder

## Running Web Api Server

Goto demo_web directory and run the following command:

```bash
python flaskr.py
```

Now navigate your browser to http://localhost:5000 and you can try out various predictors built with the following
trained classifiers:

* binary classifier on "cats vs dogs" data
* multi-class DCNN classifier trained with CIFAR-10 data
* multi-class VGG16 classifier trained with ImageNet data
* multi-class VGG19 classifier trained with ImageNet data
* multi-class Residual Network classifier trained with ImageNet data