Use Python to run the engine file of facenet to obtain 512 dimensional face coding data

I have a working facenet engine file. Now, I want to write a script in python with the following functions:

  1. Read in a face.
  2. Using the engine model of facenet, the picture is encoded to obtain 512 dimensional data.
    How can I call the engine file directly in Python and perform the above functions?

Can you give examples of Python and C + +, thank you


You can find below a detection example:


I looked at the example you gave, but it’s not what I want. I want to use the Python Api given in this link to parse and use the model.But I can’t write parsing code, so can you give me an example? thank


Please check the example below:

After you inference the model with a given input, the buffer can be copied back to the CPU with memcpy_dtoh_async(.).
Please note that you can mark the expected output layer when you convert the model into a TensorRT engine.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.