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

onnx version of this model #344

Open
MadeByKit opened this issue Jul 1, 2023 · 1 comment
Open

onnx version of this model #344

MadeByKit opened this issue Jul 1, 2023 · 1 comment

Comments

@MadeByKit
Copy link

hello @1adrianb is there an onnx runtime or openvino version for this pytorch model?
https://www.adrianbulat.com/downloads/python-fan/s3fd-619a316812.pth

your response will be appreciated

@Chappie74
Copy link

face_alignment_net = torch.jit.load('2DFAN4-cd938726ad.zip')
face_alignment_net.eval()
img_tensor = torch.randn(1, 3, 256, 256)
if img_tensor.dtype != torch.float32:
    img_tensor = img_tensor.to(torch.float32)
torch.onnx.export(face_alignment_net, img_tensor,
                  'landmark.onnx',
                  opset_version=18,  # The ONNX version to export the model tohe model's input names
                  input_names=['input0'],  # The model's input names
                  output_names=['output0']  #
                  )

# Load the ONNX model
onnx_model = onnx.load('landmark.onnx')

# Check that the model is well-formed
onnx.checker.check_model(onnx_model)

try using this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants