Skip to content

Commit

Permalink
Merge pull request #635 from sglvladi/video_processing_demo_updates
Browse files Browse the repository at this point in the history
Fix video processing tutorial
  • Loading branch information
sdhiscocks committed May 10, 2022
2 parents e2ff6cd + a9e805c commit 59c636f
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 13 deletions.
6 changes: 3 additions & 3 deletions docs/demos/Video_Processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@

if not os.path.exists(VIDEO_PATH):
yt = YouTube('http://www.youtube.com/watch?v=MNn9qKG2UFI')
yt.streams[0].download(filename=VIDEO_FILENAME)
yt.streams.get_by_itag(18).download(filename=VIDEO_PATH)

# %%
# Building the video reader
Expand Down Expand Up @@ -470,8 +470,8 @@ def draw_detections(image, detections, show_class=False, show_score=False):
prior_state = GaussianState(StateVector(np.zeros((6,1))),
CovarianceMatrix(np.diag([100**2, 30**2, 100**2, 30**2, 100**2, 100**2])))
deleter_init = UpdateTimeStepsDeleter(time_steps_since_update=3)
initiator = MultiMeasurementInitiator(prior_state, measurement_model, deleter_init,
data_associator, updater, min_points=10)
initiator = MultiMeasurementInitiator(prior_state, deleter_init, data_associator, updater,
measurement_model, min_points=10)

# %%
# Track Deletion
Expand Down
6 changes: 3 additions & 3 deletions docs/source/auto_demos/Video_Processing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
},
"outputs": [],
"source": [
"import os\nfrom pytube import YouTube\nVIDEO_FILENAME = 'sample1'\nVIDEO_EXTENTION = '.mp4'\nVIDEO_PATH = os.path.join(os.getcwd(), VIDEO_FILENAME+VIDEO_EXTENTION)\n\nif not os.path.exists(VIDEO_PATH):\n yt = YouTube('http://www.youtube.com/watch?v=MNn9qKG2UFI')\n yt.streams[0].download(filename=VIDEO_FILENAME)"
"import os\nfrom pytube import YouTube\nVIDEO_FILENAME = 'sample1'\nVIDEO_EXTENTION = '.mp4'\nVIDEO_PATH = os.path.join(os.getcwd(), VIDEO_FILENAME+VIDEO_EXTENTION)\n\nif not os.path.exists(VIDEO_PATH):\n yt = YouTube('http://www.youtube.com/watch?v=MNn9qKG2UFI')\n yt.streams.get_by_itag(18).download(filename=VIDEO_PATH)"
]
},
{
Expand Down Expand Up @@ -363,7 +363,7 @@
},
"outputs": [],
"source": [
"from stonesoup.types.state import GaussianState\nfrom stonesoup.types.array import CovarianceMatrix, StateVector\nfrom stonesoup.initiator.simple import MultiMeasurementInitiator\nfrom stonesoup.deleter.time import UpdateTimeStepsDeleter\nprior_state = GaussianState(StateVector(np.zeros((6,1))),\n CovarianceMatrix(np.diag([100**2, 30**2, 100**2, 30**2, 100**2, 100**2])))\ndeleter_init = UpdateTimeStepsDeleter(time_steps_since_update=3)\ninitiator = MultiMeasurementInitiator(prior_state, measurement_model, deleter_init,\n data_associator, updater, min_points=10)"
"from stonesoup.types.state import GaussianState\nfrom stonesoup.types.array import CovarianceMatrix, StateVector\nfrom stonesoup.initiator.simple import MultiMeasurementInitiator\nfrom stonesoup.deleter.time import UpdateTimeStepsDeleter\nprior_state = GaussianState(StateVector(np.zeros((6,1))),\n CovarianceMatrix(np.diag([100**2, 30**2, 100**2, 30**2, 100**2, 100**2])))\ndeleter_init = UpdateTimeStepsDeleter(time_steps_since_update=3)\ninitiator = MultiMeasurementInitiator(prior_state, deleter_init, data_associator, updater,\n measurement_model, min_points=10)"
]
},
{
Expand Down Expand Up @@ -437,7 +437,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.5"
"version": "3.9.6"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion docs/source/auto_demos/Video_Processing.py.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3bb4f60e68c434061bcc4598c423df3f
7b6743387b9f94bdc50f5289135ecf45
10 changes: 4 additions & 6 deletions docs/source/auto_demos/Video_Processing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ shown bellow will download the video and save it your working directory as ``sam
if not os.path.exists(VIDEO_PATH):
yt = YouTube('http://www.youtube.com/watch?v=MNn9qKG2UFI')
yt.streams[0].download(filename=VIDEO_FILENAME)
yt.streams.get_by_itag(18).download(filename=VIDEO_PATH)
Expand Down Expand Up @@ -239,7 +239,6 @@ read and visualise these frames using `matplotlib`.
ani = animation.ArtistAnimation(fig, artists, interval=20, blit=True, repeat_delay=200)
.. image:: ./images/sphx_glr_Video_Processing_001.gif
:align: center

Expand Down Expand Up @@ -530,7 +529,6 @@ of how to read and visualise these detections using `matplotlib`.
ani2 = animation.ArtistAnimation(fig2, artists2, interval=20, blit=True, repeat_delay=200)
.. image:: ./images/sphx_glr_Video_Processing_002.gif
:align: center

Expand Down Expand Up @@ -736,8 +734,8 @@ that have not been associated to a measurement in the last 3 frames.
prior_state = GaussianState(StateVector(np.zeros((6,1))),
CovarianceMatrix(np.diag([100**2, 30**2, 100**2, 30**2, 100**2, 100**2])))
deleter_init = UpdateTimeStepsDeleter(time_steps_since_update=3)
initiator = MultiMeasurementInitiator(prior_state, measurement_model, deleter_init,
data_associator, updater, min_points=10)
initiator = MultiMeasurementInitiator(prior_state, deleter_init, data_associator, updater,
measurement_model, min_points=10)
Expand Down Expand Up @@ -904,7 +902,7 @@ Running the tracker
.. rst-class:: sphx-glr-timing

**Total running time of the script:** ( 4 minutes 21.159 seconds)
**Total running time of the script:** ( 2 minutes 38.615 seconds)


.. _sphx_glr_download_auto_demos_Video_Processing.py:
Expand Down
Binary file modified docs/source/auto_demos/images/sphx_glr_Video_Processing_001.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/auto_demos/images/sphx_glr_Video_Processing_002.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/auto_demos/images/sphx_glr_Video_Processing_003.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 59c636f

Please sign in to comment.