Instance segmentation in code
It's now time to put the things that we've learned into practice. We'll use the COCO dataset and its API for the data, and use Facebook Research's Detectron project (link in References), which provides the Python implementation of many of the previously discussed techniques under an Apache 2.0 license. The code works with Python2 and Caffe2, so we'll need a virtual environment with the given configuration.
Creating the environment
The virtual environment, with Caffe2 installation, can be created as per the caffe2
installation instructions on the Caffe2 repository link in the References Section. Next, we will install the dependencies.
Installing Python dependencies (Python2 environment)
We can install the Python dependencies as shown in the following code block:
Note
Python 2X and Python 3X are two different flavors of Python (or more precisely CPython), and not a conventional upgrade of version, therefore the libraries for one variant might not be compatible with...