Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TensorRT Initialization Failure #283

Open
sayyid-abolfazl opened this issue Dec 29, 2024 · 3 comments
Open

TensorRT Initialization Failure #283

sayyid-abolfazl opened this issue Dec 29, 2024 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@sayyid-abolfazl
Copy link

sayyid-abolfazl commented Dec 29, 2024

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

@fengyuentau fengyuentau added the help wanted Extra attention is needed label Dec 30, 2024
@fengyuentau
Copy link
Member

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

@Mo-Sam-Mo
Copy link

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

@sayyid-abolfazl
Copy link
Author

sayyid-abolfazl commented Jan 4, 2025

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
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants