Semantic Segmentation [MaskRCNN] using Frozen graph for inference . The repository contains code to freeze a Keras .h5 model [.h5 to .pb] and inference using the frozen model.
Mask R-CNN is built on ResNet 101 backbone and Feature Pyramidal Network FPN .
TensorFlow v1.x , pycocotools , OpenCV , GPU [>= 4 GB RAM] . The Keras model [.h5] requires more than 4GB RAM . The frozen model can be loaded in less than 4GB memory .
Download COCO MaskRCNN trained model from here . Save in the main directory.
Freeze Model as follows .
python freeze_model.py
For Inference Provide path to frozen model and test image
python main.py -m model/mask_frozen_graph.pb -p test_image/tesla_cybertruck_F.jpg