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

MTCNN conversion to ONNX #213

Open
silviuspac opened this issue Aug 9, 2023 · 2 comments
Open

MTCNN conversion to ONNX #213

silviuspac opened this issue Aug 9, 2023 · 2 comments

Comments

@silviuspac
Copy link

Is it possible to convert MTCNN to ONNX?

@mboling6
Copy link

I am also wondering how to convert this model to ONNX format. Have you figured this out?

@Chappie74
Copy link

import onnx
import torch

from resnet import InceptionResnetV1

torch_model = InceptionResnetV1('vggface2')
torch_model.eval()
torch_input = torch.randn(1, 3, 160, 160)
torch.onnx.export(torch_model, torch_input,
                  'facenet.onnx',
                  opset_version=18,  # The ONNX version to export the model to
                  do_constant_folding=True,  # Whether to execute constant folding for optimization
                  input_names=['input0'],  # The model's input names
                  output_names=['output0']  # The model's output names
                  )

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

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

print("ONNX model is well-formed and saved successfully.")

Try modifying this.

https://pytorch.org/tutorials//beginner/onnx/export_simple_model_to_onnx_tutorial.html

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

3 participants