.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "build/examples_tracking/demo_smot.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_tracking_demo_smot.py: 03. Multiple object tracking with pre-trained SMOT models ============================================================= In this tutorial, we present a method, called `Single-Shot Multi Object Tracking (SMOT) `_, to perform multi-object tracking. SMOT is a new tracking framework that converts any single-shot detector (SSD) model into an online multiple object tracker, which emphasizes simultaneously detecting and tracking of the object paths. As an example below, we directly use the SSD-Mobilenet object detector pretrained on COCO from :ref:`gluoncv-model-zoo` and perform multiple object tracking on an arbitrary video. We want to point out that, SMOT is very efficient, its runtime is close to the runtime of the chosen detector. .. GENERATED FROM PYTHON SOURCE LINES 15-19 Predict with a SMOT model ---------------------------- First, we download a video from MOT challenge website, .. GENERATED FROM PYTHON SOURCE LINES 19-24 .. code-block:: default from gluoncv import utils video_path = 'https://motchallenge.net/sequenceVideos/MOT17-02-FRCNN-raw.webm' im_video = utils.download(video_path) .. rst-class:: sphx-glr-script-out Out: .. code-block:: none Downloading MOT17-02-FRCNN-raw.webm from https://motchallenge.net/sequenceVideos/MOT17-02-FRCNN-raw.webm... 0%| | 0/5410 [00:00
.. GENERATED FROM PYTHON SOURCE LINES 45-50 Our model is able to track multiple persons even when they are partially occluded. If you want to track multiple object categories at the same time, you can simply pass in the extra class names. For example, let's download a video from MOT challenge website, .. GENERATED FROM PYTHON SOURCE LINES 50-55 .. code-block:: default from gluoncv import utils video_path = 'https://motchallenge.net/sequenceVideos/MOT17-13-FRCNN-raw.webm' im_video = utils.download(video_path) .. rst-class:: sphx-glr-script-out Out: .. code-block:: none Downloading MOT17-13-FRCNN-raw.webm from https://motchallenge.net/sequenceVideos/MOT17-13-FRCNN-raw.webm... 0%| | 0/7685 [00:00
.. GENERATED FROM PYTHON SOURCE LINES 74-75 Try SMOT on your own video and see the results! .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 2.981 seconds) .. _sphx_glr_download_build_examples_tracking_demo_smot.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: demo_smot.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: demo_smot.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_