[go: nahoru, domu]

Skip to content

A pill recognition REST API using Convolutional Neural Networks.

License

Notifications You must be signed in to change notification settings

ruifgmonteiro/pilldex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pilldex

Pilldex: A pill recognition REST API using Convolutional Neural Networks.

Getting Started

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.

Preview

Pilldex

Prerequisites

  • OpenCV
  • Keras
  • Sqlite3
  • CUDA
  • Flask

Local Installation

Clone the repo

$ git clone https://github.com/ruifgmonteiro/pilldex.git

Change directoy

$ cd pilldex

Create virtual environment

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

Install necessary python packages and modules

pip install .

Install requirements

$ pip install -r requirements.txt

Make sure you have the following installed:

  • tensorflow
  • keras
  • flask
  • pillow
  • h5py
  • gevent
  • sqlite3

Run with Python

Python 2.7 or 3.5+ are supported and tested.

Train the model

$ cd /pilldex/train

$ python train.py --dataset dataset --model pilldex.model --labelbin lb.pickle

Check training progress in Tensorboard.

$ tensorboard --logdir=Log/ --port=8101

Create the database to store the pills data

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

Run the application

$ python app.py

After the app is running, upload the images you want to classify and check the results!

Built With

  • 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

Authors

  • Rui Monteiro - Initial work - rfgm6

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • Adrian Rosebrock from PyImageSearch

More resources

About

A pill recognition REST API using Convolutional Neural Networks.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published