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

I think the issue is that in the ONNX model, in addition to the image, it also receives face coordinates and landmarks, but in netron, nothing is visible.

This means the model crops the image, then aligns it, and extracts features. Could you please guide me on how to solve this challenge?

_recognizer alignCrop feature :

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

sface_class

Is it possible to simplify the model so that it only performs facial feature extraction and removes other operations such as facial alignment, cropping, and similarity calculation from the model?

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

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 problem is that in the onnx model, in addition to the image, it receives 15 decimal numbers that include the coordinates of the face box and landmarks and Confidence, but in the network input there are only the dimensions of the network input, which are 112 * 112.

How do I define 15 decimal numbers in Tensor RT? And get the correct output? I tried several methods, but I did not get the correct output.

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