Error when use FaceDetection model with deepstream_test1_app

I tried to modify the deepstream_test1_app go with deepstream 4.0.1 on Jetson Nano to use FaceDetection models from this repository: https://github.com/PKUZHO/MTCNN_FaceDetection_TensorRT.

Here is the content of configuration file:

[property]
gpu-id=0
# net-scale-factor=0.0039215697906911373
model-file=det1_relu.caffemodel
proto-file=det1_relu.prototxt
labelfile-path=labels.txt
batch-size=1
network-mode=1
num-detected-classes=1
interval=0
gie-unique-id=1
output-blob-names=conv2;prob1

[class-attrs-all]
threshold=0.2
eps=0.2
group-threshold=1

Here is the content of labels.txt

Face

Here is the error:

Now playing:face_detection_config.txt
Opening in BLOCKING MODE 
Creating LL OSD context new
0:00:00.905058496 31713   0x558c656e10 INFO                 nvinfer gstnvinfer.cpp:519:gst_nvinfer_logger:<nv-inference-engine> NvDsInferContext[UID 1]:initialize(): Trying to create engine from model files
0:00:00.905254126 31713   0x558c656e10 WARN                 nvinfer gstnvinfer.cpp:515:gst_nvinfer_logger:<nv-inference-engine> NvDsInferContext[UID 1]:generateTRTModel(): INT8 not supported by platform. Trying FP16 mode.
0:01:19.596060515 31713   0x558c656e10 INFO                 nvinfer gstnvinfer.cpp:519:gst_nvinfer_logger:<nv-inference-engine> NvDsInferContext[UID 1]:generateTRTModel(): Storing the serialized cuda engine to file at /deepstream-test-applications/models/mtcnn_tensorrt_caffe/det1_relu.caffemodel_b1_fp16.engine
Running...
NvMMLiteOpen : Block : BlockType = 261 
NVMEDIA: Reading vendor.tegra.display-size : status: 6 
NvMMLiteBlockCreate : Block : BlockType = 261 
Creating LL OSD context new
0:01:19.806082258 31713   0x7f44003d40 WARN                 nvinfer gstnvinfer.cpp:1149:convert_batch_and_push_to_input_thread:<nv-inference-engine> error: NvBufSurfTransform failed with error -2 while converting buffer
Error received from element nv-inference-engine: NvBufSurfTransform failed with error -2 while converting buffer.
Deleting pipeline

How can I fix this problem? How can I dig deeper to check what’s error -2 mean?

Hi,

Please noticed that the output format of the detection model may be different.
So you will need to update the bounding box parser based on your customized model.

Please check this GitHub for some information.
It shows how to enable a customized bbox parser for DetectNet.
[url]https://github.com/AastaNV/DeepStream[/url]

Thanks.

Hi,

I’ve used the cusomtized bbox parser for DetectNet in https://github.com/AastaNV/DeepStream.

But the interface of bbox parser function doesn’t match with DeepStream 4.0.1:
https://docs.nvidia.com/metropolis/deepstream/4.0/dev-guide/DeepStream_Development_Guide/baggage/group__ee__custominference__group.html#gaea80f85cf9229f7782a3bdcb26e24de4

Here is the error:

0:01:33.461221133 16387   0x559efeede0 ERROR                nvinfer gstnvinfer.cpp:511:gst_nvinfer_logger:<nv-inference-engine> NvDsInferContext[UID 1]:fillDetectionOutput(): Failed to parse bboxes using custom parse function

Do you have any suggest for bbox parser function that works with DetectNet on DeepStream 4.0.1.

For me it looks like bbox parsing function from your sample looks incorrect. Find invocation of parsing function from deepstream nvinfer module and you’ll see that exporect prototype is a bit different. Use prototype from yolo sample from deepstream4.

Hi,

The parser shared in the comment#2 is developed with DeepStream 3.0.
You will need some update for v4.0.1 but the procedures should be similar.

More, we also got some suggestions from our internal team:

1). The input size of your model is very small (12x12).
Downscaling to such small size might result in error since the maximal ratio of downscale engine is 1/16.
It’s recommended to apply the downscale in two steps: either use one more convert before inference or change the output size at muxer.

2. It’s also recommended to try our face detection model:
[url]https://github.com/NVIDIA-AI-IOT/redaction_with_deepstream[/url]

Thanks.

Hi,
Thanks you very much for your help.