Pilldex: A pill recognition REST API using Convolutional Neural Networks.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
- Clone this repo
- Install requirements
- Train the model
- Run the script
- Check http://localhost:5000
- OpenCV
- Keras
- Sqlite3
- CUDA
- Flask
$ git clone https://github.com/ruifgmonteiro/pilldex.git
$ cd pilldex
It is recommended to create a virtual environment to run the application so you can package your application without messing with other python installations.
You just need to give this environment a name and run the following commands:
$ python3 -m venv ./<env_name>
Activate your python environment:
$ source <env_name>/bin/activate
If you want to deactivate it just run
deactivate
pip install .
$ pip install -r requirements.txt
Make sure you have the following installed:
- tensorflow
- keras
- flask
- pillow
- h5py
- gevent
- sqlite3
Python 2.7 or 3.5+ are supported and tested.
$ cd /pilldex/train
$ python train.py --dataset dataset --model pilldex.model --labelbin lb.pickle
$ tensorboard --logdir=Log/ --port=8101
Before running the application you need to setup the database and create the table to store the relevant information.
Change to the actual database directory:
$ cd /pilldex/app/database
Run the script to create both the pills database and table:
$ python create_db.py
Run the script to insert the data in the table:
$ python insert_db.py
$ python app.py
After the app is running, upload the images you want to classify and check the results!
- OpenCV - Computer Vision Library
- Flask - The web framework used
- Keras - Python high level deep learning library
- Tensorflow - An open source machine learning library for research and production.
- Sqlite3 - Database engine
- Rui Monteiro - Initial work - rfgm6
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details
- Adrian Rosebrock from PyImageSearch