Utilities for working with Mask R-CNN, a neural network for object instance segmentation.
The data preparation pipeline to train a model to segment vein instances using Mask R-CNN is as follows:
Labelbox -> ImageSplitter -> ImageDistributer (test vs rest) -> Augmentor -> ImageDistributer (train vs val)-> MaskRCNN
The steps are explained as follows:
python -u labelbox_parser.py \
--labelbox_json_file path/to/labelbox.json \
--labelbox_class_names "Sulphide/Partial Sulphide" --labelbox_class_names "Pure Quartz Carbonate" \
--output_dir path/to/labelbox_parser/output \
--resize_images
python -u image_splitter.py --input_dir path/to/labebox_parser/output/ --output_dir path/to/image_splitter/output/
python -u separate_test_and_augmentation_images.py \
--labelbox_output_dir path/to/labelbox_parser/output/ \
--image_splitter_output_dir path/to/image_splitter/output/with_labels_only \
--output_test_dir path/to/mrcnn/dataset/stage1_test \
--output_augmentation_dir path/to/output/augmentation_raw \
--labelbox_class_names "Sulphide/Partial Sulphide" --labelbox_class_names "Pure Quartz Carbonate"
python -u augmentation.py \
--input_dir path/to/augmentation_raw/ \
--output_dir path/to/augmenation/output/ \
--number_of_augmented_images_per_original 20 \
--no-augment_colour
python -u separate_train_and_val_images.py \
--input_dir path/to/augmentation/output \
--output_dir path/to/mrcnn/dataset/ \
--labelbox_class_names "Sulphide/Partial Sulphide" --labelbox_class_names "Pure Quartz Carbonate"
path/to/mrcnn/dataset/
contains stage1_train
, val
and stage1_test
dataset directories which can used in Mask R-CNN training and inference.