Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel
zhliu 46bfd6b89c
Update to 1.0.2 release
3 years ago
..
46bfd6b89c
Update to 1.0.2 release
3 years ago
46bfd6b89c
Update to 1.0.2 release
3 years ago
46bfd6b89c
Update to 1.0.2 release
3 years ago
46bfd6b89c
Update to 1.0.2 release
3 years ago

README

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
  1. ################################################################################
  2. # Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
  3. #
  4. # Permission is hereby granted, free of charge, to any person obtaining a
  5. # copy of this software and associated documentation files (the "Software"),
  6. # to deal in the Software without restriction, including without limitation
  7. # the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. # and/or sell copies of the Software, and to permit persons to whom the
  9. # Software is furnished to do so, subject to the following conditions:
  10. #
  11. # The above copyright notice and this permission notice shall be included in
  12. # all copies or substantial portions of the Software.
  13. #
  14. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  17. # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  20. # DEALINGS IN THE SOFTWARE.
  21. ################################################################################
  22. Prerequisites:
  23. - DeepStreamSDK 5.1
  24. - Python 3.6
  25. - Gst-python
  26. - NumPy package
  27. - OpenCV package
  28. To install required packages:
  29. $ sudo apt update
  30. $ sudo apt install python3-numpy python3-opencv -y
  31. To run:
  32. $ python3 deepstream_segmentation.py <config_file> <jpeg/mjpeg stream> <FOLDER NAME TO SAVE FRAMES>
  33. This document shall describe the sample deepstream-segmentation application.
  34. It is meant for simple demonstration of how to use the various DeepStream SDK
  35. elements in the pipeline and extract meaningful insights from a video stream such
  36. as segmentation masks and respective color mapping for segmentation visualizaiton.
  37. This sample creates instance of "nvinfer" element. Instance of
  38. the "nvinfer" uses TensorRT API to execute inferencing on a model. Using a
  39. correct configuration for a nvinfer element instance is therefore very
  40. important as considerable behaviors of the instance are parameterized
  41. through these configs.
  42. For reference, here are the config files used for this sample :
  43. 1. The 4-class segmentation model configured through dstest_segmentation_config_semantic.txt
  44. 2. The 2-class segmentation model configured through dstest_segmentation_config_industrial.txt
  45. In this sample, we first create one instance of "nvinfer", referred as the pgie.
  46. for semantic segmentation, it needs semantic model which can get 4 classes map,
  47. including backgroud, car, person, bicycle. Then "nvsegvidsual" plugin chooses 4 different
  48. colors for them and to display. Similarlty for industrial segmentation, it needs industrial
  49. model which can only get defective area map. Later nvinfer element attach some MetaData
  50. to the buffer. By attaching the probe function at the end of the pipeline, one can
  51. extract meaningful information from this inference. Please refer
  52. the "tiler_src_pad_buffer_probe" function in the sample code. For details on the
  53. Metadata format, refer to the file "gstnvdsmeta.h". In this probe we demonstrate
  54. extracting the masks and color mapping for segmentation visualization using opencv
  55. and numpy.
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...