pillsCounter

A Pills Counter with OpenCV and Mask_RCNN by Deep Learning

Setup

  1. Clone our pills counter: git clone git@github.com:Rqcker/pillsCounter.git

  2. Download the Mask_RCNN pre-trained network and place it in our project root directory: mask_rcnn_coco.h5

  3. Install Mask-RCNN: Please check MaskRCNN Setup

  4. And create sym-link to link the mrcnn package to our project like:

ln -s <Mask_RCNN Folder Path> <Your New Folder Name Path should in our projct root directory>

HowTo

  1. We can use python3 pills.py --mode investigate to run investugate at first to check our samples

  2. Then we can use python3 pills.py --mode train to training our model via our 30 pictures of round pill, it should be have 10 epochs and free to change, logs and final model will be stored in the logs folder

  3. When we got final trained model like mask_rcnn_pills_0010.h5 and we can predicting our model with our examples(free to add as well): python3 pills.py --mode predict --image examples/pills_01.jpg --weights logs/pills20200717T1421/mask_rcnn_pills_0010.h5

Project Structure

    |--- pillsCounter
    | |--- pills/
    | | |--- images
    | | |--- via_region_data.json
    | |--- pills.py
    | |--- mask_rcnn_coco.h5 (user to be added when in setup stage)
    | |--- mrcnn/ (user to be added when in setup stage)