VOOZH about

URL: https://www.digitalocean.com/community/tutorials/mask-r-cnn-in-tensorflow-2-0

โ‡ฑ Object Detection Using Mask R-CNN with TensorFlow 1.14 and Keras | DigitalOcean


Object Detection Using Mask R-CNN with TensorFlow 1.14 and Keras

Updated on July 23, 2025
๐Ÿ‘ Object Detection Using Mask R-CNN with TensorFlow 1.14 and Keras

Mask R-CNN is an object detection model based on deep convolutional neural networks (CNN) developed by a group of Facebook AI researchers in 2017. The model can return both the bounding box and a mask for each detected object in an image.

The model was originally developed in Python using the Caffe2 deep learning library. The original source code is available on GitHub. To support the Mask R-CNN model with more popular libraries, such as TensorFlow, there is a popular open-source project called Mask_RCNN that offers an implementation based on Keras and TensorFlow 1.14.

Google officially released TensorFlow 2.0 in September 2020. Compared to TensorFlow 1.0, it is better organized and much easier to learn.

This tutorial uses the TensorFlow 1.14 release of the Mask_RCNN project to both make predictions and train the Mask R-CNN model using a custom dataset.

Key Takeaways

  • Mask R-CNN is a powerful deep learning model that extends Faster R-CNN by adding a branch for predicting segmentation masks on each detected object.
  • It enables both object detection and instance segmentation, making it suitable for tasks requiring pixel-level object boundaries.
  • The tutorial uses TensorFlow 1.14 and Keras, which are compatible with the open-source Mask_RCNN implementation by Matterport.
  • You need to prepare a custom dataset with images, bounding boxes, and masks in a compatible format before training the model.
  • The workflow includes data preparation, model configuration, training, and inference, providing a hands-on guide for real-world applications.
  • While TF 1.14 is outdated, this project still serves as a strong foundation for learning core object detection and segmentation concepts.
  • Mask R-CNNโ€™s modular design makes it extensible and customizable for a variety of use cases in computer vision.

This tutorial covers the following:

  • Overview of the Mask_RCNN Project
  • Object Detection with TensorFlow 1.14
  • Preparing the Model Configuration Parameters
  • Building the Mask R-CNN Model Architecture
  • Loading the Model Weights
  • Reading an Input Image
  • Detecting Objects
  • Visualizing the Results
  • Complete Code for Prediction
  • Downloading the Training Dataset
  • Preparing the Training Dataset
  • Preparing Model Configuration
  • Training Mask R-CNN in TensorFlow 1.14
  • Conclusion

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products

About the author(s)

๐Ÿ‘ Ahmed Fawzy Gad
Ahmed Fawzy Gad
Author
๐Ÿ‘ Shaoni Mukherjee
Shaoni Mukherjee
Editor
AI Technical Writer
See author profile

With a strong background in data science and over six years of experience, I am passionate about creating in-depth content on technologies. Currently focused on AI, machine learning, and GPU computing, working on topics ranging from deep learning frameworks to optimizing GPU-based workloads.

Still looking for an answer?

Was this helpful?

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

๐Ÿ‘ Creative Commons
This work is licensed under a Creative Commons Attribution-NonCommercial- ShareAlike 4.0 International License.
  • Limited Time: Introductory GPU Droplet pricing.

    Get simple AI infrastructure starting at $2.99/GPU/hr on-demand. Try GPU Droplets now!

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and AI-native businesses

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOceanโ€™s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow โ€” whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

ยฉ 2026 DigitalOcean, LLC.Sitemap.
Dark mode is coming soon.