bubble detector is a model for detecting the position and shape of bubbles using mask cnn. This program can only be run on a GPU platform, as cuda capabilites are needed.
Step 0.Download and install Miniconda from the official website. Step 1.Create a conda environment and activate it, terminal should be opened where you downloaded bubble_detector
cd bubble_detector
conda create --name bubble_project python=3.8 -y
conda activate bubble_project
Step 2.Install CudaToolKit
conda install anaconda::cudatoolkit==11.8.0
Step 3.Install Pytorch following official instructions, e.g.
conda install pytorch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 pytorch-cuda=11.8 -c pytorch -c nvidia
Step 4.Install OpenMIM
pip install -U openmim
Step 5.Install requirements
pip install -r requirements/pip.txt
mim install -r requirements/mim.txt
Detecting Black and White, B/W images will be output in the runs folder under detect*
python detect_BW.py ./models/bubble_swin-b/config.py <path-to-checkpoint.pth> <path-to-bubble-images>
Training
python train.py <path-to-training dataset>
If you want to configure the learning settings detail, edit config/cascade_mask_rcnn__fpn.py following official guide.
bubble_dataset: Dataset for Instans Segmentation in COCO format with configuration in data.yaml. bubblr_swin-b: Configuration and checkpoints learned mask-rcnn with swin-b backbone in bubble_dataset.