"# Novel class segmentation demo with Deep-MAC\n",
"\n",
"Welcome to the Novel class segmentation (with Deep-MAC) demo --- this colab loads a Deep-MAC model and tests it interactively with user-specified boxes. Deep-MAC was only trained to detect and segment COCO classes, but generalizes well when segmenting within user-specified boxes of unseen classes.\n",
"\n",
"Estimated time to run through this colab (with GPU): 10-15 minutes.\n",
"Note that the bulk of this time is in installing Tensorflow and downloading\n",
"the checkpoint then running inference for the first time. Once you've done\n",
"all that, running on new images is very fast."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "Kq1eGNssiW31"
},
"source": [
"# Prerequisites\n",
"\n",
"Please change runtime to GPU."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "UT7N0HJhiRKr"
},
"source": [
"# Installation and Imports\n",
"\n",
"This takes 3-4 minutes."
]
},
{
"cell_type": "code",
"metadata": {
"id": "nNdls0Pe0UPK"
},
"source": [
"!pip install -U --pre tensorflow==\"2.2.0\"\n",
"\n",
"import os\n",
"import pathlib\n",
"\n",
"# Clone the tensorflow models repository if it doesn't already exist\n",
"if \"models\" in pathlib.Path.cwd().parts:\n",
" while \"models\" in pathlib.Path.cwd().parts:\n",