The DSL shared library is built using GCC and GNU Make. The MakeFile is located in the DSL root folder. There are a few simple steps involved in creating and installing the shared library, libdsl.so
. The current default make
-- prior to releasing DSL v1.0 -- builds DSL into a command line test-executable for running all API and Unit level test cases. The DSL source-only object files, built for the test application, are re-linked into the libdsl.so
shared library.
- Clone this repository to pull down all source
- Use the make (all) default to build the
dsl-test-app
executable - Use the
sudo make install
option to build the object files intolibdsl.so
and intall the lib - Generate trafficcamnet engine files (optional)
- Import the shared lib using Python3
Clone the repository to pull all source code required to build the DSL test application - then navigate to the deepstream-services-library
root folder.
git clone https://github.com/prominenceai/deepstream-services-library.git
cd deepstream-services-library
Import Note: When building with GStreamer v1.18 on Ubuntu 20.04, you will need to set the GStreamer sub version in the Makefile to 18 for the WebRTC Sink and WebSocket source code to be included in the build.
Invoke the standard make (all) to compile all source code and test scenarios into objects files, and link them into a Catch2 test application. On successful build, the dsl-test-app
will be found under the same root folder.
make -j$(nproc)
Once the dsl-test-app.exe has been created, the source-only objects can be re-linked into the libdsl.so
with the make install option. Root level privileges are required for the Makefile to copy the lib to /usr/local/lib
once built.
The DSL Python bindings file (dsl.py) is also copied to .local/lib/python3.6/site-packages
with the following command.
sudo make install
execute the python script in the deepstream-services-library
root folder.
sudo python3 make_trafficcamnet_engine_files.py
Note: this script can take several minutes to run.
The following files are generated
/opt/nvidia/deepstream/deepstream/samples/models/Primary_Detector/resnet18_trafficcamnet.etlt_b8_gpu0_int8.engine
/opt/nvidia/deepstream/deepstream/samples/models/Secondary_VehicleMake/resnet18_vehiclemakenet.etlt_b8_gpu0_int8.engine
/opt/nvidia/deepstream/deepstream/samples/models/Secondary_VehicleTypes/resnet18_vehicletypenet.etlt_b8_gpu0_int8.engine
Update the Primary detector path specification in the script to generate files for other devices.
The shared lib libdsl.so
is mapped to Python3 using CTypes in the python module dsl.py
.
Import dsl into your python code.
#!/usr/bin/env python
from dsl import *
# New CSI Live Camera Source
retval = dsl_source_csi_new('csi-source', 1280, 720, 30, 1)
if retval != DSL_RETURN_SUCCESS:
print(retval)
# --- handle error
- Installing DSL Dependencies
- Building and Importing DSL
- Overview
- List of all Services
- Pipeline
- Player
- Source
- Tap
- Dewarper
- Preprocessor
- Inference Engine and Server
- Tracker
- Segmentation Visualizer
- Tiler
- Demuxer and Splitter Tees
- Remuxer
- On-Screen Display
- Sink
- Branch
- Component
- GST Element
- Pad Probe Handler
- ODE Trigger
- ODE Accumulator
- ODE Action
- ODE Area
- ODE Heat-Mapper
- Display Type
- Mailer
- WebSocket Server
- Message Broker
- Info API