.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "build/examples_detection/demo_ssd.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_detection_demo_ssd.py: 01. Predict with pre-trained SSD models ========================================== This article shows how to play with pre-trained SSD models with only a few lines of code. First let's import some necessary libraries: .. GENERATED FROM PYTHON SOURCE LINES 9-13 .. code-block:: default from gluoncv import model_zoo, data, utils from matplotlib import pyplot as plt .. GENERATED FROM PYTHON SOURCE LINES 14-22 Load a pretrained model ------------------------- Let's get an SSD model trained with 512x512 images on Pascal VOC dataset with ResNet-50 V1 as the base model. By specifying ``pretrained=True``, it will automatically download the model from the model zoo if necessary. For more pretrained models, please refer to :doc:`../../model_zoo/index`. .. GENERATED FROM PYTHON SOURCE LINES 22-25 .. code-block:: default net = model_zoo.get_model('ssd_512_resnet50_v1_voc', pretrained=True) .. rst-class:: sphx-glr-script-out Out: .. code-block:: none /usr/local/lib/python3.6/dist-packages/mxnet/gluon/block.py:1512: UserWarning: Cannot decide type for the following arguments. Consider providing them as input: data: None input_sym_arg_type = in_param.infer_type()[0] Downloading /root/.mxnet/models/ssd_512_resnet50_v1_voc-9c8b225a.zip from https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/models/ssd_512_resnet50_v1_voc-9c8b225a.zip... 0%| | 0/132723 [00:00` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: demo_ssd.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_