FastMaskRCNN_ForwardTest This is a forward test script of a single input image for the FastMaskRCNN: https://github.com/CharlesShang/FastMaskRCNN
Requirements Functionalities Draw bounding box of the predicted RoI
Draw mask of the predicted RoI (without bbox)
Draw mask of the predicted RoI with its bbox and predicted categroy
Getting Start It requires you to download the whole repo firstly from https://github.com/CharlesShang/FastMaskRCNN
Add the whole dir ./forward_test
under the root of the repo; then replace the original ./libs/visualization/pil_utils.py
with the new one in my repo. Downloading the 2 pre-trained models above and place them(with the ./output/mask_rcnn/checkpoint
) as shown below. Finally the folder structure would be:
root/
├── data/pretrained_models/resnet_v1_50.ckpt
│ └── ......
│
├── forward_test/
│ ├── testdata/
│ ├── output/
│ └── forward_test_single_image.py
│
├── libs/
│ ├── visualization/
│ │ ├── pil_utils.py
│ │ └── ......
│ ├── nets/
│ │ ├── pyramid_network.py
│ │ └── ......
│ └── ......
│
├── output/mask_rcnn/
│ ├── checkpoint
│ ├── coco_resnet50_model.ckpt-2499999.data-00000-of-00001
│ ├── coco_resnet50_model.ckpt-2499999.index
│ └── coco_resnet50_model.ckpt-2499999.meta
└── ...... Modify original ./libs/nets/pyramid_network.py
according to Issues#1-F3 and Issues#1-F4 . Or you can just replace the original one with mine.
Put your test image under ./forward_test/testdata/
(Optional) If you want to change the output image dir, modify the code ./forward_test/forward_test_single_image.py
at Line30-31
save_dir_bbox = 'output/bbox/'
save_dir_mask = 'output/mask/' (Optional) If your test image is in PNG format, modify the code ./forward_test/forward_test_single_image.py
at Line32
file_pattern = 'jpg' # or 'png' run ./forward_test/forward_test_single_image.py
and wait for the result
Acknowledgment The ./forward_test/forward_test_single_image.py
is modified from the original ./train/train.py
from FastMaskRCNN
The ./libs/visualization/pil_utils.py
is modified from @chen1005 's suggestion
The pre-trained Mask-RCNN model from @QtSignalProcessing
To-Do