A Pills Counter with OpenCV and Mask_RCNN by Deep Learning
Clone our pills counter: git clone git@github.com:Rqcker/pillsCounter.git
Download the Mask_RCNN pre-trained network and place it in our project root directory: mask_rcnn_coco.h5
Install Mask-RCNN: Please check MaskRCNN Setup
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>
We can use python3 pills.py --mode investigate
to run investugate at first to check our samples
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
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
|--- 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)