.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "build/examples_segmentation/demo_deeplab.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_build_examples_segmentation_demo_deeplab.py: 3. Test with DeepLabV3 Pre-trained Models ====================================== This is a quick demo of using GluonCV DeepLabV3 model on ADE20K dataset. Please follow the `installation guide <../../index.html#installation>`__ to install MXNet and GluonCV if not yet. .. GENERATED FROM PYTHON SOURCE LINES 8-16 .. code-block:: default import mxnet as mx from mxnet import image from mxnet.gluon.data.vision import transforms import gluoncv # using cpu ctx = mx.cpu(0) .. GENERATED FROM PYTHON SOURCE LINES 17-21 Prepare the image ----------------- download the example image .. GENERATED FROM PYTHON SOURCE LINES 21-26 .. code-block:: default url = 'https://github.com/zhanghang1989/image-data/blob/master/encoding/' + \ 'segmentation/ade20k/ADE_val_00001755.jpg?raw=true' filename = 'ade20k_example.jpg' gluoncv.utils.download(url, filename, True) .. rst-class:: sphx-glr-script-out Out: .. code-block:: none Downloading ade20k_example.jpg from https://github.com/zhanghang1989/image-data/blob/master/encoding/segmentation/ade20k/ADE_val_00001755.jpg?raw=true... 0%| | 0/13 [00:00` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: demo_deeplab.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_