-
Notifications
You must be signed in to change notification settings - Fork 185
Fixed documentation for concurrent use of DL Streamer and DeepStream #679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+181
−107
Merged
Changes from 9 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
c4061c3
Fixed documentation for concurrent use of DL Streamer and DeepStream
marcin-wadolkowski 457c26b
Fixed documentation for concurrent use of DL Streamer and DeepStream,…
marcin-wadolkowski b4e6573
Fixed documentation for concurrent use of DL Streamer and DeepStream,…
marcin-wadolkowski e834614
Update docs/source/dev_guide/concurrent.md
marcin-wadolkowski cd35859
Update docs/source/dev_guide/concurrent.md
marcin-wadolkowski 35e2d84
Update docs/source/dev_guide/concurrent.md
marcin-wadolkowski 18ee2c2
Merge branch 'main' into ITEP-81301
marcin-wadolkowski fb3622c
Coexistence DL Streamer and DeepStream documentation fixes
marcin-wadolkowski 0ae71a5
Coexistence DL Streamer and DeepStream documentation fixes, part2
marcin-wadolkowski aae66ec
Coexistence DL Streamer and DeepStream documentation fixes, part3
marcin-wadolkowski f442560
Coexistence DL Streamer and DeepStream documentation fixes, part4
marcin-wadolkowski de74c4d
Coexistence DL Streamer and DeepStream documentation fixes, flowchart
marcin-wadolkowski b4b21c2
Coexistence DL Streamer and DeepStream, fixed scripts
marcin-wadolkowski 4636c62
Coexistence DL Streamer and DeepStream, fixes after code review
marcin-wadolkowski 8401e92
Coexistence DL Streamer and DeepStream, fixes after code review, part2
marcin-wadolkowski 136d44f
Merge branch 'main' into ITEP-81301
marcin-wadolkowski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,96 @@ | ||
| # Coexisting use of DL Streamer and DeepStream | ||
|
|
||
| This tutorial explains how to simultaneously or sequentially run DL Streamer and DeepStream on a single machine for optimal performance. | ||
| It serves two main purposes: | ||
| 1. It shows DeepStream users that DL Streamer has similar capabilities and can be used for their use cases with very low time and effort investment. | ||
| - The sample adds DL Streamer to Intel-powered setups without disrupting the current environment configuration. | ||
| - It enables you to run and compare results of typical use cases. | ||
| 2. It demonstrates how additional machine resources can be utilized. For example, if a user runs detection on an NVIDIA GPU, they can simultaneously execute a DL Streamer pipeline on an Intel integrated GPU, NPU, or CPU. This approach enables more efficient utilization of the system's available compute resources. | ||
|
|
||
| ## Overview | ||
|
|
||
| Systems equipped with both NVIDIA GPUs and Intel hardware (GPU/NPU/CPU) can achieve enhanced performance by distributing workloads across available accelerators. Rather than relying solely on DeepStream for pipeline execution, you can offload additional processing tasks to Intel accelerators, maximizing system resource utilization. | ||
|
|
||
| A Python script [coexistence_dls_and_ds.py](https://github.com/open-edge-platform/dlstreamer/blob/main/samples/gstreamer/python/coexistence/coexistence_dls_and_ds.py) is provided to facilitate this coexisting setup. It assumes that Docker and Python are properly installed and configured. Ubuntu 24.04 is currently the only supported operating system. | ||
|
|
||
| ## Detection algorithm | ||
|
|
||
| The DL Streamer pipeline performs license plate detection and subsequently applies OCR to recognize the text. In contrast, the DeepStream pipeline first detects the vehicle, then identifies the license plate within the detected vehicle object, and finally performs OCR to recognize the text. | ||
|
|
||
| ## Hardware detection | ||
|
|
||
| The list of available GPUs is retrieved using the `lspci -nn` Linux utility. | ||
| NPU detection is performed by verifying the existence of the `/dev/accel` directory. | ||
| CPU information is obtained using the `lscpu` Linux utility. | ||
|
|
||
| ```python | ||
| # Check for Intel and Nvidia hardware | ||
| lspci_output=os.popen("lspci -nn").read().split("\n") | ||
| video_pattern = re.compile("^.*?(VGA|3D|Display).*$") | ||
| INTEL_GPU=False | ||
| NVIDIA_GPU=False | ||
| INTEL_NPU=False | ||
| INTEL_CPU=False | ||
| for pci_dev in lspci_output: | ||
| if video_pattern.match(pci_dev) and "Intel" in pci_dev: | ||
| INTEL_GPU=True | ||
| elif video_pattern.match(pci_dev) and "NVIDIA" in pci_dev: | ||
| NVIDIA_GPU=True | ||
|
|
||
| if os.path.exists("/dev/accel"): | ||
| INTEL_NPU=True | ||
| lscpu_output=os.popen("lscpu").read().replace("\n", " ") | ||
| if "Intel" in lscpu_output: | ||
| INTEL_CPU=True | ||
| ``` | ||
|
|
||
| ## How it works | ||
|
|
||
| 1. Using the **intel/dlstreamer:2026.0.0-ubuntu24** image. | ||
|
|
||
| The sample downloads `yolov8_license_plate_detector` and `ch_PP-OCRv4_rec_infer` | ||
| models to `./public` directory if they were not downloaded yet. | ||
|
|
||
| 2. Using the **nvcr.io/nvidia/deepstream:8.0-samples-multiarch** image. | ||
|
|
||
| The sample downloads the `deepstream_tao_apps` repository to the `./deepstream_tao_apps` | ||
| directory. Then, it downloads models for License Plate Recognition (LPR), | ||
| makes a custom library and copies dict.txt to the current directory if `deepstream_tao_apps` | ||
| does not exist. | ||
|
|
||
| 3. Hardware detection depends on the setup. The algorithm is as follows: | ||
|
|
||
| - Run pipeline simultaneously on both devices for: | ||
| - both Nvidia and Intel GPUs | ||
| - if not available then use Nvidia GPU and Intel NPU | ||
| - if not available then use Nvidia GPU with Intel CPU | ||
| - If not available then run pipeline directly per device in the following order: | ||
| - Intel GPU | ||
| - Nvidia GPU | ||
| - Intel NPU | ||
| - Intel CPU | ||
|
|
||
| ## How to use | ||
|
|
||
| Running pipelines simultaneously on DL Streamer and DeepStream: | ||
|
|
||
| ```sh | ||
| python3 ./coexistence_dls_and_ds.py <input> LPR <output> -simultaneously | ||
| ``` | ||
|
|
||
| Running pipelines sequentially on DL Streamer and DeepStream: | ||
|
|
||
| ```sh | ||
| python3 ./coexistence_dls_and_ds.py <input> LPR <output> | ||
| ``` | ||
|
|
||
| - `input` can be an RTSP or HTTPS stream, or a file. | ||
| - License Plate Recognition (LPR) is currently the only supported pipeline. | ||
| - `output` is the filename. For example, the `Output.mp4` or `Output` parameters | ||
| will create the `Output_dls.mp4` (DL Streamer output) and/or `Output_ds.mp4` | ||
| (DeepStream output) files. | ||
| - Use the `-simultaneously` argument when the user wants to run pipelines concurrently. If the user wants to run pipelines sequentially, no argument is required. | ||
|
|
||
| ## Notes | ||
|
|
||
| First-time download of the Docker images and models may take a long time. |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 @@ | ||
| :content-doc{path="../../../docs/source/dev_guide/coexisting.md"} |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 @@ | ||
| :content-doc{path="../../../../docs/source/dev_guide/coexisting.md"} |
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this file; there will be only one located in samples/gstreamer/python/coexistence