• NVIDIA GPU Driver Version (valid for GPU only):
565.57.01
I am developing a DeepStream application that currently utilizes a primary people detection model, followed by secondary face detection and face recognition models. I aim to incorporate gender classification by processing the outputs of the face detection model. Could you provide guidance on the following aspects?
Model Integration: Is it advisable to add a separate gender classification model after the face detection stage, or should I integrate gender classification into an existing model? If a separate model is recommended, how should it be configured within the DeepStream pipeline?
Pipeline Configuration: What modifications are necessary in the DeepStream configuration files to include the gender classification model? Specifically, how should the deepstream_app_config.txt and secondary GIE configuration files be adjusted?
Code Implementation: Are there any required changes to the deepstream_app.c source code to support the addition of the gender classification model? If so, which sections of the code should be modified?
Your guidance on these aspects will be instrumental in successfully extending the capabilities of my DeepStream application.
In your application, the pipeline shoule be pgie(person detection)->sgie0(face detection)->sgie1(gender classification). Here are two solutions.
Currently, deepstream-app only supports one detection model as pgie. please refer to this topic. this user succeeded to use “face detection->gender classification” in deepstream-app.
if you still need to use two detection models. please refer to the ready-made person-face detection sample. Based on ths sample, you only need to add gender classification model. plese refer to sample deepstream_lpr_app for how to add a classifction model after two detection models. especially in cfg, please set correct operate-on-gie-id .
Now, I need to add a gender classification model after face detection (SGIE1). My goal is to classify gender based on detected faces.
Steps Taken So Far:
Face detection (SGIE1) is already operating on PGIE output.
Face recognition (SGIE2) is operating on SGIE1 output.
Questions:
How should I configure SGIE3 for gender classification?
Should operate-on-gie-id be set to 3 (face detection) or 4 (face recognition)?
Do I need to modify operate-on-class-ids?
Code Changes in deepstream-app.c
In which function should I extract NvDsClassifierMeta for gender classification?
How can I correctly parse the classification label and display it in my app?
Proposed Configuration Update:
Add Gender Classification (SGIE3) in deepstream_app_config.txt
[secondary-gie3]
enable=1
batch-size=1
gpu-id=0
gie-unique-id=5
operate-on-gie-id=3 # Face Detection GIE ID
operate-on-class-ids=0
nvbuf-memory-type=0
config-file=/home/jayadevice0001/Jayachandaran_AI/src/deepstream-app-facerecognition/config/config_genderclassification.txt
Expected Behavior:
The gender classification model should run on detected faces from SGIE1.
Gender metadata should be extracted and displayed in the C code.
Request:
Can you confirm if the configuration is correct?
What changes are needed in deepstream-app.c to retrieve and process gender classification metadata?
are you developing based on deepstream-app? deepstream-app can’t support back-to-back detection models. please refer to the point1 in my last comment.
if using the solution2 in my last comment, you only need to add a gender classification model as SGIE2 to sample back-to-back-detectors. About operate-on-class-ids of sgie2, it should be set to the gieid of sgie1.