-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #692 from aisingapore/dev
Merge `dev` into `main` for v1.3 release
- Loading branch information
Showing
226 changed files
with
14,522 additions
and
1,054 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
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.
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.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
:orphan: | ||
|
||
.. include:: /include/substitution.rst | ||
|
||
.. _applications: | ||
|
||
********************* | ||
PeekingDuck Ecosystem | ||
********************* | ||
|
||
This section covers the extensions to the PeekingDuck ecosystem. | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
/ecosystem/viewer | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
****************** | ||
PeekingDuck Viewer | ||
****************** | ||
|
||
.. include:: /include/substitution.rst | ||
|
||
.. _pkd_viewer: | ||
|
||
The PeekingDuck Viewer offers you an interactive GUI application to manage and run | ||
PeekingDuck pipelines, and to view and analyze the output video. | ||
|
||
|
||
Running the Viewer | ||
------------------ | ||
|
||
The PeekingDuck Viewer can be activated using the CLI ``--viewer`` option: | ||
|
||
.. admonition:: Terminal Session | ||
|
||
| \ :blue:`[~user]` \ > \ :green:`peekingduck run \-\-viewer` \ | ||
A screenshot of the Viewer and its GUI components is shown below: | ||
|
||
.. figure:: /assets/tutorials/viewer_main.png | ||
:alt: PeekingDuck Viewer Screenshot | ||
|
||
The PeekingDuck Viewer screen, with explanations for the main controls. | ||
|
||
Once the Viewer screen appears, PeekingDuck will begin executing the current pipeline. | ||
The pipeline output is displayed as a video in the center of the screen, with a progress | ||
bar below it. | ||
|
||
If pipeline input length is deterministic (e.g. using a video file as the source), the | ||
progress bar functions like a normal progress bar moving from start to end. | ||
Upon completion, the progress bar will be replaced with a slider that you can use | ||
to navigate the output video. | ||
|
||
If the length is non-deterministic (e.g. capturing a webcam video), then the progress bar | ||
will function in a non-deterministic manner: animating itself to indicate progress | ||
but without an end point (as PeekingDuck has no idea how long the webcam video will be). | ||
In this case, click the ``Play/Stop`` button to end the webcam video capture, and the | ||
progress bar will become a slider. | ||
|
||
|
||
Navigating the Output Video | ||
--------------------------- | ||
|
||
You can examine the output video of the executed pipeline by using the | ||
``Play/Stop`` button to replay the entire video. | ||
|
||
You may also scrub through the video using the slider to go directly to the frames | ||
of interest. | ||
The current video frame number is shown to the right of the slider, serving as a | ||
position indicator. | ||
To "jump" to a particular position on the slider, click the *right* mouse button on that | ||
position. | ||
To move frame-by-frame forward/backward, click the *left* mouse button anywhere to the | ||
right/left of the current slider position. | ||
|
||
The ``+`` (zoom in) and ``-`` (zoom out) buttons allow you to adjust the video size. | ||
You may also use keyboard shortcuts to adjust the zoom: ``CTRL`` - ``-`` zoom out, | ||
``CTRL`` - ``+`` zoom in, ``CTRL`` - ``=`` reset zoom | ||
|
||
|
||
Using the Pipeline Playlist | ||
--------------------------- | ||
|
||
Clicking the ``Playlist`` button will show/hide the playlist. | ||
|
||
.. figure:: /assets/tutorials/viewer_playlist.png | ||
:alt: PeekingDuck Viewer with Playlist Screenshot | ||
|
||
PeekingDuck Viewer with playlist shown. | ||
|
||
The above screenshot shows the playlist on the right. | ||
The playlist is a collection of pipeline files that can be run with PeekingDuck. | ||
The current pipeline is automatically added to the playlist. | ||
This playlist is specific to you and is saved across different PeekingDuck Viewer runs. | ||
|
||
Click to select a pipeline in the playlist. The pipeline's information will be displayed in | ||
the ``Pipeline Information`` panel below. It shows the pipeline's name, last modified date/time, | ||
and full file path. | ||
|
||
To run the currently selected pipeline, click the ``Run`` button. | ||
|
||
The ``Add`` button lets you manually add a pipeline file to the playlist. It will display | ||
a File Explorer dialog. Use it to select a PeekingDuck pipeline YAML file and it will be | ||
added to your playlist. | ||
|
||
The ``Delete`` button will remove the currently selected pipeline from the playlist, after | ||
you have confirmed the deletion. | ||
|
||
If the pipeline in the playlist is red, it means the pipeline YAML file is missing. | ||
This could mean the pipeline had been added earlier, but its YAML file had since been | ||
deleted or moved to another folder. | ||
Delete the missing pipeline entry to remove it from the playlist. | ||
|
||
The list of pipelines can be sorted in reverse order by clicking the playlist header. | ||
|
||
.. note:: | ||
|
||
The playlist is saved in `~/.peekingduck/playlist.yml`, where `~` is the user's home folder. | ||
|
||
|
||
Exiting the Viewer | ||
------------------ | ||
|
||
To exit the Viewer, close the Viewer window. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
:orphan: | ||
|
||
.. include:: /include/substitution.rst | ||
|
||
.. _edge_ai: | ||
|
||
******* | ||
Edge AI | ||
******* | ||
|
||
PeekingDuck supports running optimized TensorRT [1]_ models on devices with NVIDIA GPUs. | ||
Using the TensorRT model on these devices provides a speed boost over the regular | ||
TensorFlow/PyTorch version. | ||
A potential use case is running PeekingDuck on an NVIDIA Jetson device for Edge AI | ||
inference. | ||
|
||
Currently, PeekingDuck includes TensorRT versions of the following models: | ||
|
||
#. MoveNet model for pose estimation, | ||
#. YOLOX model for object detection. | ||
|
||
|
||
Installing TensorRT | ||
=================== | ||
|
||
The following packages are required to run PeekingDuck's TensorRT models: | ||
|
||
#. TensorFlow | ||
#. PyTorch | ||
#. PyCUDA | ||
|
||
As the actual installation steps vary greatly depending on the user's device, operating | ||
system, software environment, and pre-installed libraries/packages, | ||
we are unable to provide step-by-step installation instructions. | ||
|
||
The user may refer to `NVIDIA's TensorRT Documentation | ||
<https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html>`_ for detailed | ||
TensorRT installation information. | ||
|
||
|
||
|
||
|
||
|
||
Using TensorRT Models | ||
===================== | ||
|
||
To use the TensorRT version of a model, change the ``model_format`` of the model | ||
configuration to ``tensorrt``. | ||
|
||
The following ``pipeline_config.yml`` shows how to use the MoveNet TensorRT model | ||
for pose estimation: | ||
|
||
.. code-block:: yaml | ||
:linenos: | ||
nodes: | ||
- input.visual: | ||
source: https://storage.googleapis.com/peekingduck/videos/wave.mp4 | ||
- model.movenet: | ||
model_format: tensorrt | ||
model_type: singlepose_lightning | ||
- draw.poses | ||
- dabble.fps | ||
- draw.legend: | ||
show: ["fps"] | ||
- output.screen | ||
The following ``pipeline_config.yml`` shows how to use the YOLOX TensorRT model | ||
for object detection: | ||
|
||
.. code-block:: yaml | ||
:linenos: | ||
nodes: | ||
- input.visual: | ||
source: https://storage.googleapis.com/peekingduck/videos/cat_and_computer.mp4 | ||
- model.yolox: | ||
detect: ["cup", "cat", "laptop", "keyboard", "mouse"] | ||
model_format: tensorrt | ||
model_type: yolox-tiny | ||
- draw.bbox: | ||
show_labels: True # configure draw.bbox to display object labels | ||
- dabble.fps | ||
- draw.legend: | ||
show: ["fps"] | ||
- output.screen | ||
Performance Speedup | ||
=================== | ||
|
||
The following charts show the speed up obtainable with the TensorRT models. | ||
The numbers were obtained from our in-house testing with the actual devices. | ||
|
||
|
||
NVIDIA Jetson Xavier NX with 8GB RAM | ||
------------------------------------ | ||
|
||
.. figure:: /assets/charts/tensorrt_nx_movenet_fps.png | ||
.. figure:: /assets/charts/tensorrt_nx_yolox_fps.png | ||
|
||
Jetson Xavier NX specs used for testing: [2]_ | ||
|
||
``CPU``: 6 cores (6MB L2 + 4MB L3) |br| | ||
``GPU``: 384-core Volta, 48 Tensor cores |br| | ||
``RAM``: 8 GB | ||
|
||
|
||
NVIDIA Jetson Xavier AGX with 16GB RAM | ||
-------------------------------------- | ||
|
||
.. figure:: /assets/charts/tensorrt_agx_movenet_fps.png | ||
.. figure:: /assets/charts/tensorrt_agx_yolox_fps.png | ||
|
||
Jetson Xavier AGX specs used for testing: [3]_ | ||
|
||
``CPU``: 8 cores (8MB L2 + 4MB L3) |br| | ||
``GPU``: 512-core Volta, 64 Tensor cores |br| | ||
``RAM``: 16 GB | ||
|
||
|
||
Test Conditions | ||
^^^^^^^^^^^^^^^ | ||
|
||
The following test conditions were followed: | ||
| - :mod:`input.visual`, the model of interest, and :mod:`dabble.fps` nodes were used to perform | ||
inference on videos | ||
| - 2 videos were used to benchmark each model, one with only 1 human (``single``), and the other | ||
with multiple humans (``multiple``) | ||
| - Both videos are about 1 minute each, recorded at ~30 FPS, which translates to about 1,800 | ||
frames to process per video | ||
| - 1280×720 (HD ready) resolution was used, as a bridge between 640×480 (VGA) of poorer quality | ||
webcams, and 1920×1080 (Full HD) of CCTVs | ||
| - FPS numbers are averaged over 5 separate runs | ||
|
||
References | ||
========== | ||
|
||
.. [1] `NVIDIA TensorRT Reference <https://developer.nvidia.com/tensorrt>`_ | ||
.. [2] `NVIDIA Jetson Xavier NX Tech Specs <https://developer.nvidia.com/embedded/jetson-xavier-nx-devkit>`_ | ||
.. [3] `NVIDIA Jetson Xavier AGX Tech Specs <https://developer.nvidia.com/embedded/jetson-agx-xavier-developer-kit>`_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.