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

ViTPose #2183

Merged
merged 8 commits into from
Feb 18, 2025
Merged

ViTPose #2183

merged 8 commits into from
Feb 18, 2025

Conversation

ariG23498
Copy link
Contributor

This PR will:

  1. Add the dummy inputs
  2. Build a small model
  3. Add test

CC: @xenova

I am following this guide. While @xenova has already taken care of the configurations and registry, I am trying to push this PR to the end line.

Currently the following works

from pathlib import Path
from optimum.exporters import TasksManager
from optimum.exporters.onnx import export
from transformers import VitPoseForPoseEstimation

base_model = VitPoseForPoseEstimation.from_pretrained("usyd-community/vitpose-base-simple")

onnx_path = Path("model.onnx")
onnx_config_constructor = TasksManager.get_exporter_config_constructor("onnx", base_model, library_name="transformers", task="keypoint-detection")
onnx_config = onnx_config_constructor(base_model.config)

print(onnx_config)

onnx_inputs, onnx_outputs = export(base_model, onnx_config, onnx_path, onnx_config.DEFAULT_ONNX_OPSET)

Are there any other immediate check that I need to perform?

@ariG23498 ariG23498 requested a review from xenova February 10, 2025 11:09
Copy link
Contributor

@xenova xenova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ariG23498! Could you merge the commits from #2098 into this PR too so we only have one PR to review/merge? Thanks!

@ariG23498 ariG23498 changed the base branch from vitpose-onnx to main February 11, 2025 06:27
@ariG23498
Copy link
Contributor Author

@xenova I have made the adjustments. Is it okay now?

@ariG23498 ariG23498 requested a review from xenova February 11, 2025 06:31
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@xenova xenova mentioned this pull request Feb 11, 2025
3 tasks
Copy link
Contributor

@xenova xenova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added support for exporting models with num_experts>1 and things seem to work well. I've also created a tiny-random model which can be used for testing. Other than that, LGTM ✅

cc @echarlaix for final review :)

@xenova xenova requested a review from echarlaix February 11, 2025 12:36
Copy link
Collaborator

@echarlaix echarlaix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks a lot !

@echarlaix echarlaix merged commit 0245619 into huggingface:main Feb 18, 2025
29 of 37 checks passed
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

Successfully merging this pull request may close these issues.

4 participants