This is a custom gst-nvinfer plugin to do some preprocess and postprocess.
- Deepstream 6.0+
- Opencv
This demo supports models:
If want to use other models, codes in tensor_extractor.cpp
should be modified for extracting landmarks from original tensor-output and align_funcitons
.
for detector
- add landmarks in
nvdsinfer
so it can be processed together with bondingboxes innvdsinfer_customparser
- if
numLmks
not 0, we concat landmarks to the end of labels - decode landmarks in
attach_metadata_detector
and attach them to user metadata
for classifier
- decode landmarks in object_user_metadata
- use opencv to do alignment and replace original surface in gpu memory
- Done!
A backup is strongly recommended!!!!
- replace
nvdsinfer.h
. It's under/opt/nvidia/deepstream/deepstream/sources/includes
in official docker. - set cuda environment
export CUDA_VER=11.6
- modify nvdsinfer_parser
set
oinfo.numLmks
andoinfo.landmarks
properties - compile nvdsinfer
cd nvdsinfer
make
make install
NOTE: To compile the sources, run make with "sudo" or root permission.
- compile gst-nvinfer
cd gst-nvinfer
make
make install
- set config file
for all detectors, set cluster-mode=4
since we only modify fillUnclusteredOutput
.
cluster-mode=4
for detector which output landmarks
enable-output-landmark = 1
for classifier which generate feature use kyewords
- alignment-type:
- 1: face -> Retinaface
- 2: license plate -> Retina_License_Plate
- alignment-pics-path: path to save pictures
Example
alignment-type=2
License Plate Saved input NvBufSurface
- use npp to do alignment
- improve stucture of passing lmks