question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RetinaFaceAntiCov TRT Inference

See original GitHub issue

Hello. I’m trying to use this pretrained insightface model with tensorrt. Successfully converted into trt format but having trouble when making predictions. I keep the original retina inference code. Maybe this model has different output shape then it causes an error:

File "/FaceRecognize/src/converters/modules/model_zoo/detectors/retinaface.py", line 322, in postprocess
    landmark_deltas = landmark_deltas.transpose((0, 2, 3, 1)).reshape((-1, 5, landmark_pred_len // 5))
ValueError: cannot reshape array of size 16320 into shape (5,0)

Could you please give me a hand to solve this?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
SthPhoenixcommented, Nov 5, 2020

Hi! RetinaFaceAntiCov has quiet different postprocessing code from original RetinaFace. Also its model has additional output for mask predictions.

You should first add proper output mapping to src/converters/modules/configs.py. Refer to retinaface_outputs as example. New outputs are labeled like face_rpn_type_prob_reshape_stride.

Than you should add proper code for this output processing as in retinaface_cov.py in official repo to src/converters/modules/model_zoo/detectors/retinaface.py

1reaction
xxxpsyduckcommented, Nov 5, 2020

Update: link to converted model

Read more comments on GitHub >

github_iconTop Results From Across the Web

wang-xinyu/tensorrtx - GitHub
Load the TensorRT engine and run inference. ... Deploy YOLOv4 with Triton Inference Server · From pytorch to trt step by step, hrnet...
Read more >
Inference with Python scripts using .trt TensorRT on JetsonTX2
I have managed to convert gaze model, emotionNet and heartRateNet as well as face detection and facial landmarks from model.etlt to TensorRT ...
Read more >
github.com-wang-xinyu-tensorrtx_-_2021-07-06_14-00-04
I wrote this project to get familiar with tensorrt API, and also to share and learn from the community. All the models are...
Read more >
RetinaFace MXNet模型转ONNX转TensorRT_令狐傻笑的博客
detection/RetinaFaceAntiCov 文件夹中,通过以下命令生成ONNX文件。 ... R50.trt" BATCH_SIZE: 1 INPUT_CHANNEL: 3 IMAGE_WIDTH: 640 IMAGE_HEIGHT: ...
Read more >
Deploy ONNX models with TensorRT Inference Serving
$ sudo nvidia-docker build --rm -t trt_client:v1 -f Dockerfile.client . 3. MODEL REPOSITORY. TensorRT server only recognizes the inference ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found