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

Arcface Model Conversion #139

Open
BasharMahasen opened this issue May 12, 2024 · 0 comments
Open

Arcface Model Conversion #139

BasharMahasen opened this issue May 12, 2024 · 0 comments

Comments

@BasharMahasen
Copy link

BasharMahasen commented May 12, 2024

Hello @ltdat1201, @shitouren1994 ,
we are trying to convert Arcface ONNX to joint format to use it on AX620 chip. The conversion for both w600k_R50 & w600k_mbf were successful, however, the cosine on test (pulsar run ...onnx ... joint) is always ZERO. I attached the configurations, and the logs for one trials to narrow it down and solve the issue. I appreicate if you could:

  1. Advise if prototxt file is correct for Arcface mbf.?
  2. As output_config shows, joint model applies permutation on the input (NHWC -> NCHW). does this mean that "pulsar run" of "onnx and joint" can't be done for the same input (to test similarity). For this I manually tried to feed each model a separate npy which matches the input, then manually compute cosine, but still the result is close to zero.
  3. Any suggestions / hints that may help solving this issue?

Attached configs for your reference:

  1. The calibration dataset is float32 arranged in NHWC / RGB as per the onnx model format.

  2. Arcface models:
    pip install insightface
    from insightface.app import FaceAnalysis
    app = FaceAnalysis('buffalo_sc') # downloads w600_mbf.onnx
    app = FaceAnalysis('buffalo_l') # downloads w600k_r50.onnx

  3. output_config.prototxt.txt

  4. w600k_mbf_float32.prototxt.txt

  5. generate_npyfp32_calibration_dataset.py.txt

  6. pulsar_run_test.log

  7. puslar_build.log

@BasharMahasen BasharMahasen changed the title Significant loss for Arcface (R50 & MBF) Models Arcface Model Conversion May 13, 2024
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

1 participant