-
Notifications
You must be signed in to change notification settings - Fork 11.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
2,578 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Color Spash 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. | ||
|
||
## Installation | ||
From the [Releases page](https://github.com/matterport/Mask_RCNN/releases) page: | ||
1. Download `mask_rcnn_balloon.h5`. Save it in the root directory of the repo (the `mask_rcnn` directory). | ||
2. Download `balloon_dataset.p3`. Expand it such that it's in the path `mask_rcnn/datasets/balloon/`. | ||
|
||
## Apply color splash using the provided weights | ||
Apply splash effect on an image: | ||
|
||
```bash | ||
python3 balloon.py splash --weights=/path/to/mask_rcnn/mask_rcnn_balloon.h5 --image=<file name or URL> | ||
``` | ||
|
||
Apply splash effect on a video. Requires OpenCV 3.2+: | ||
|
||
```bash | ||
python3 balloon.py splash --weights=/path/to/mask_rcnn/mask_rcnn_balloon.h5 --video=<file name or URL> | ||
``` | ||
|
||
|
||
## 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 | ||
``` | ||
python3 balloon.py train --dataset=/path/to/balloon/dataset --weights=coco | ||
``` | ||
|
||
Resume training a model that you had trained earlier | ||
``` | ||
python3 balloon.py train --dataset=/path/to/balloon/dataset --weights=last | ||
``` | ||
|
||
Train a new model starting from ImageNet weights | ||
``` | ||
python3 balloon.py train --dataset=/path/to/balloon/dataset --weights=imagenet | ||
``` | ||
|
||
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. |
Oops, something went wrong.