To train a dataset on weights pretrained on the COCO dataset:
python gdxray.py train --dataset=PATH_TO_/Mask-R-CNN/datasets/gdxray --weights=coco
To train a dataset on weights pretrained on the ImageNet dataset:
python gdxray.py train --dataset=PATH_TO_/Mask-R-CNN/datasets/gdxray --weights=imagenet
To resume training from a pevious execution:
python gdxray.py train --dataset=PATH_TO_/Mask-R-CNN/datasets/gdxray --weights=last
To evaluate last model trained:
python gdxray.py eval --weights=last
To evaluate a specific set of weights:
python gdxray.py eval --weights=/path/to/weights.h5
Example weights location = PATH_TO_/Mask-R-CNN/logs/shuriken_gun20190407T0317/mask_rcnn_shuriken_gun_0030.h5
tensorboard --logdir=/path/to/log/folder
Example log directory = PATH_TO_/Mask-R-CNN/logs/shuriken_gun20190409T0146
To make changes to the layers, check the PATH_TO_/Mask-R-CNN/mrccn/model.py file.
Follow these steps if you want to preserve the gdxray dataset and scripts and create a different workspace.
Annotations must at least contain the following fields:
- class label
- id (can be filename)
- path (full path to image)
- height
- width
- segmentation mask (can be stored in any format as long as it can be converted to a binary mask when loading)
-
Create dataset folders under datasets:
*/Mask-R-CNN/datasets/dataset_name/ */Mask-R-CNN/datasets/dataset_name/train */Mask-R-CNN/datasets/dataset_name/val -
Move training data *Move training image-annotation pairs into /Mask-R-CNN/datasets/dataset_name/train *Move test image-annotation pairs into /Mask-R-CNN/datasets/dataset_name/val
- Create copy of gdxray folder in /Mask-R-CNN/samples
- (Optional) Rename folder and script file (gdxray.py)
- (Optional) Rename class objects such as GDXrayConfig and GDXrayDataset in the script file (previously gdxray.py).
- Update references in both jupyter notebooks to reference the new dataset and configs
To ensure data is in correct format, run the jupyter notebook "inspect_data.ipynb". This notebook will load the dataset and the ground truth masks. Any issues should be evident.