Skip to content

TensorRT Initialization Failure #283

Closed as not planned
Closed as not planned

Description

@sayyid-abolfazl

Hello guys, thank you all for everything.

I am trying to use the s_face face_recognition model in tensorRT mode :

https://github.com/opencv/opencv_zoo/tree/main/models/face_recognition_sface

To start, I checked the model with the netron tool to get the model inputs and outputs :

sface_netron

Now, let's compare two photos for a test :

onnx_sface

This is my program at this address
https://github.com/sayyid-abolfazl/sface_trt

and its output is not correct
trt

The problem is that the feature vectors obtained in the onnx model are completely different from the Nvidia TRT version, and I don't know where the problem lies.

https://github.com/opencv/opencv_zoo/blob/main/models/face_recognition_sface/demo.cpp

sface_class

It should be noted that if you use the align and crop method, the results are slightly different from the case where you just send the cropped face image without alignment, but in the TRT the results are completely different.

I tried several different methods, such as changing the color channel or the order of the channels and how the network blob was created, but I didn't get the right output.

I am trying to use the model's own alignment and cropping mode and send the image with 15 facial coordinates to it, but currently the output in normal mode is completely wrong.

class_trt

Activity

  1. fengyuentau commented on Dec 30, 2024

    @fengyuentau
    Member

    Hello, TensorRT is not supported by OpenCV. For helpful and faster responses, you should go to https://www.nvidia.com/en-us/forums/.

  2. Mo-Sam-Mo commented on Jan 1, 2025

    @Mo-Sam-Mo

    Hi,
    I’d like to help with this issue. Could you provide more context or guidance on where to start?

  3. sayyid-abolfazl commented on Jan 4, 2025

    @sayyid-abolfazl
    Author

    Hi, I’d like to help with this issue. Could you provide more context or guidance on where to start?

    Hello, Thank you for your support.

    To start, please run my program, which is based on the Tensor RT library
    https://github.com/sayyid-abolfazl/sface_trt

    to use the onnx model in Tensor RT, you need to check the input and output of the network and then implement it in Tensor RT.

    The output of the TRT model is completely different and I don't know what the problem is.

    I used fp16 - fp32 - best modes to get TRT output but the results are still wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions