"**A tool to visualize the segmentation model inference output.**\\\n",
"This tool is used verify that the exported tflite can produce expected segmentation results.\n",
"\n"
"[](https://colab.research.google.com/github/tensorflow/models/blob/master/official/projects/edgetpu/vision/serving/inference_visualization_tool.ipynb)\n",
"\n",
"# Visualizing segmentation outputs using colab.\n",
"\n",
"This file is located in [github](https://github.com/tensorflow/models/blob/master/official/projects/edgetpu/vision/serving/inference_visualization_tool.ipynb) and uses [colab integration](https://colab.research.google.com/github/tensorflow/models/blob/master/official/projects/edgetpu/vision/serving/inference_visualization_tool.ipynb) to seemlessly show [segmentation model](https://github.com/tensorflow/models/blob/master/official/projects/edgetpu/vision/README.md) outputs."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "dHWaHWjYJEsE"
},
"source": [
"## Setup sandbox\n",
"\n",
"Imports required libs and get ready to load data."
]
},
{
"cell_type": "code",
"metadata": {
"id": "YWVHsuCiJHjo"
},
"source": [
"from google.colab import auth # access to saved model in tflite format\n",
"auth.authenticate_user()\n",
"from PIL import Image # used to read images as arrays\n",
"import tensorflow as tf # runs tested model\n",
"import numpy as np # postprocessing for render.\n",
"from scipy import ndimage # postprocessing for render.\n",
"Running this notebook will show sample segmentation of 3 pictures from [ADE20K](https://groups.csail.mit.edu/vision/datasets/ADE20K/) dataset. You can try it on other pictures by adding you own URLS to `IMAGE_URLS` list."