This is a project of Multiphase flow & Flow visualization Lab for bubble detection and mask extraction. The purpose of the project is to automatically extract bubble mask of experimental images from various experimental conditions using deep learning model. More information can be found in the paper (Kim & Park, 2021).
The codes are based on Matterport Mask R-CNN implementation, using ResNet-101 as the backbone and applied transfer learning from pre-trained COCO weights.
The output of the model is as follows:
The repository includes:
This code was tested on the below environment.
requirements.txt
.Prepare images (JPG or PNG or TIF) under a series of folders ending in _###
folder_001, folder_002 ...
path/to/image
become .../folder
Clone this repository
Install dependencies
pip3 install -r requirements.txt
Run setup from the repository root directory
python3 setup.py install
Download trained weights (mask_rcnn_bubble.h5) from the link.
Run bubble detection script in bubble/
directory to visualize color mask
(supports only 3-channel jpg image or video)
bubble$ python3 bubble.py splash --weights=path/to/mask_rcnn_bubble.h5 --image=path/to/image
for the video:
bubble$ python3 bubble.py splash --weights=path/to/mask_rcnn_bubble.h5 --video=path/to/video
Run bubble detection script in bubble/
directory to extract logical mask and bubble properties
(JPG or PNG or TIF images)
bubble$ python3 bubble.py detect --weights=path/to/mask_rcnn_bubble.h5 --image=path/to/image --results=/path/to/results --folder_num_start=0 --folder_num=1 --confidence=0.5 to 0.99