Color Splash Example
This is an example showing the use of Mask RCNN in a real application. We train the model to detect balloons only, and then we use the generated masks to keep balloons in color while changing the rest of the image to grayscale.
This blog post describes this sample in more detail.
Installation
From the Releases page page:
Download
mask_rcnn_balloon.h5
. Save it in the root directory of the repo (themask_rcnn
directory).Download
balloon_dataset.zip
. Expand it such that it's in the pathmask_rcnn/datasets/balloon/
.
Apply color splash using the provided weights
Apply splash effect on an image:
Apply splash effect on a video. Requires OpenCV 3.2+:
Run Jupyter notebooks
Open the inspect_balloon_data.ipynb
or inspect_balloon_model.ipynb
Jupter notebooks. You can use these notebooks to explore the dataset and run through the detection pipelie step by step.
Train the Balloon model
Train a new model starting from pre-trained COCO weights
Resume training a model that you had trained earlier
Train a new model starting from ImageNet weights
The code in balloon.py
is set to train for 3K steps (30 epochs of 100 steps each), and using a batch size of 2. Update the schedule to fit your needs.