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
- Host: GitHub
- URL: https://github.com/chen0040/keras-image-classifier-web-api
- Owner: chen0040
- License: mit
- Created: 2017-09-14T08:07:42.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-14T05:54:14.000Z (about 8 years ago)
- Last Synced: 2025-04-03T13:48:00.093Z (about 1 year ago)
- Topics: flask, image-classifier, keras, keras-image-classifier, ml-web, multi, train-classifier
- Language: Python
- Size: 83.2 MB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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