Repository navigation
Add Sapiens2 Model - #45919
Add Sapiens2 Model#45919
Conversation
|
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. |
molbap
left a comment
There was a problem hiding this comment.
Nice! Left a small initial review
…into add-sapiens2
|
run-slow: auto, sapiens2 |
|
This comment contains models: ["models/auto", "models/sapiens2"] |
CI ResultsCommit Info
The test failure analysis could not be completed. Please check the workflow run for details. |
|
run-slow: auto, sapiens2 |
|
This comment contains models: ["models/auto", "models/sapiens2"] |
|
run-slow: auto, sapiens2 |
|
[For maintainers] Suggested jobs to run (before merge) run-slow: auto, sapiens2 |
1 similar comment
|
[For maintainers] Suggested jobs to run (before merge) run-slow: auto, sapiens2 |
|
This comment contains models: ["models/auto", "models/sapiens2"] |
* Add sapiens2 * Add attention * Add todo * Update norm * fix-repo * Amend * Fix tests * Update license * Fix docstrings * Add backbone test * Fix rescale * Add checkpoint conversion * Add expected logits * Remove unused class definitions * Default to bf16 for rope * Update layer_norm_eps * Update test * Update rope and test * Format * Handle layernorm * Add layer_types * Update image loading in test * Add docs * Update config attributes * Add semantic segmentation * Update logits for 1024x768 * Update logits for 1024x768 * Update seg conversion * Update seg inference tests * Add segmentation docs * Add masks preprocessing * Move head args to config * Add pose head * Add pose mapping * Add pose image processing * Update test inference configs * Fix test * Update test configs * Update expected heatmap size * Fix pose processing * Add to ignore_non_auto * Fix test * Format * Update kv group handling * Update conv layer * Remove pose head * Deduplicate image processing code * Fix modeling * Fix mapping * Move image processing to top * Remove todo * Add normal estimation * Fix normal * Add normal test logits * Remove original_sizes * Add pointmap estimation * Update pointmap tests * Refactor scale head * Adjust tol * Cleanup * Add matting * Update tests * Move comment * Fix head inits * Refactor heads * Fix test * Speed up tests * Fix test * More test cleanup * Add cuddn.deterministic = True * Add matting tests * Use num_key_value_heads_per_layer * Cleanup tests * Cleanup docstrings * Cleanup docstrings * Update docs * Add flip_pairs * Remove check * Remove todos * Add matting composite * Add flip test * Add matting background test * Fix test * Fix test * Simplify rope * Fix test * Try replace periods with inv_freq * Try replace periods with inv_freq * Inherit from DINOv3RopePositionEmbedding * Fix rope dtype * Fix rope * Update docs * Use revision in tests * Remove default head configs * Update automodels * Fix pose bbox output * Add target_sizes to post_process_pose_estimation * Fix docs * Format * Add flip_pairs to config * Use dinov3 rope * Fix * Fix * Remove cv2 dependency from processing * Remove np dependency from processing * Cleanup * Batch pose pre- and post-processing * Fix tests * Fix pose bbox postprocessing * Cleanup * Batch crop_and_resize * Add outputs_flipped * Return normals as dict * Return dict from pointmaps * Cleanup * Update docs * Remove cxcywh in function names * Clarify boxes shapes * Cleanup hessian computation * Cleanup processor inheritance * Cleanup processor inheritance * Rename Matting to ImageMatting following VitMatte * Inherit vitpose output * Cleanup * Use LlamaRMSNorm * Merge conv layers * Merge PixelShuffle * Merge heads * Refactor final layer * Add head_scale_final_input_size to config * Rename to model * Cleanup _init_weights * Remove post_init() * Cleanup tests * Add head_config * Speed up postprocessors * Add flip_pairs to config * Fix head config docstring * Add head config to docs * Cleanup * Add auto models * Use analytical hessian solution * Rename boxes * Update mask_token handling * Update config * Update configs * Update docs * Cleanup patch size handling * Use hfoption * Cleanup var names * Fix auto * Fix automodel * Adress review * Cleanup docs * Cleanup scale_final_input_size init * Add spacing * Cleanup * Remove layer_norm_eps and apply_layernorm from config * Update Sapiens2ConvLayer * Add decorators for task model forward again * Update docs * Cleanup boxes * Remove last_hidden_state from backbone output * Remove redundant test * Added PPOCRV5ServerDetConvBatchnormLayer again * Remove revision * Remove hopper expectation in tests * Fix DataParallel forward * Ignore missing mask token * Update publish date * fix: Upload test images to hf-internal-testing
* Add sapiens2 * Add attention * Add todo * Update norm * fix-repo * Amend * Fix tests * Update license * Fix docstrings * Add backbone test * Fix rescale * Add checkpoint conversion * Add expected logits * Remove unused class definitions * Default to bf16 for rope * Update layer_norm_eps * Update test * Update rope and test * Format * Handle layernorm * Add layer_types * Update image loading in test * Add docs * Update config attributes * Add semantic segmentation * Update logits for 1024x768 * Update logits for 1024x768 * Update seg conversion * Update seg inference tests * Add segmentation docs * Add masks preprocessing * Move head args to config * Add pose head * Add pose mapping * Add pose image processing * Update test inference configs * Fix test * Update test configs * Update expected heatmap size * Fix pose processing * Add to ignore_non_auto * Fix test * Format * Update kv group handling * Update conv layer * Remove pose head * Deduplicate image processing code * Fix modeling * Fix mapping * Move image processing to top * Remove todo * Add normal estimation * Fix normal * Add normal test logits * Remove original_sizes * Add pointmap estimation * Update pointmap tests * Refactor scale head * Adjust tol * Cleanup * Add matting * Update tests * Move comment * Fix head inits * Refactor heads * Fix test * Speed up tests * Fix test * More test cleanup * Add cuddn.deterministic = True * Add matting tests * Use num_key_value_heads_per_layer * Cleanup tests * Cleanup docstrings * Cleanup docstrings * Update docs * Add flip_pairs * Remove check * Remove todos * Add matting composite * Add flip test * Add matting background test * Fix test * Fix test * Simplify rope * Fix test * Try replace periods with inv_freq * Try replace periods with inv_freq * Inherit from DINOv3RopePositionEmbedding * Fix rope dtype * Fix rope * Update docs * Use revision in tests * Remove default head configs * Update automodels * Fix pose bbox output * Add target_sizes to post_process_pose_estimation * Fix docs * Format * Add flip_pairs to config * Use dinov3 rope * Fix * Fix * Remove cv2 dependency from processing * Remove np dependency from processing * Cleanup * Batch pose pre- and post-processing * Fix tests * Fix pose bbox postprocessing * Cleanup * Batch crop_and_resize * Add outputs_flipped * Return normals as dict * Return dict from pointmaps * Cleanup * Update docs * Remove cxcywh in function names * Clarify boxes shapes * Cleanup hessian computation * Cleanup processor inheritance * Cleanup processor inheritance * Rename Matting to ImageMatting following VitMatte * Inherit vitpose output * Cleanup * Use LlamaRMSNorm * Merge conv layers * Merge PixelShuffle * Merge heads * Refactor final layer * Add head_scale_final_input_size to config * Rename to model * Cleanup _init_weights * Remove post_init() * Cleanup tests * Add head_config * Speed up postprocessors * Add flip_pairs to config * Fix head config docstring * Add head config to docs * Cleanup * Add auto models * Use analytical hessian solution * Rename boxes * Update mask_token handling * Update config * Update configs * Update docs * Cleanup patch size handling * Use hfoption * Cleanup var names * Fix auto * Fix automodel * Adress review * Cleanup docs * Cleanup scale_final_input_size init * Add spacing * Cleanup * Remove layer_norm_eps and apply_layernorm from config * Update Sapiens2ConvLayer * Add decorators for task model forward again * Update docs * Cleanup boxes * Remove last_hidden_state from backbone output * Remove redundant test * Added PPOCRV5ServerDetConvBatchnormLayer again * Remove revision * Remove hopper expectation in tests * Fix DataParallel forward * Ignore missing mask token * Update publish date * fix: Upload test images to hf-internal-testing
What does this PR do?
There is an open PR for the original Sapiens model (v1) from 2024: #33167 I started from scratch for v2 as it supersedes the old version.
Sapiens2 repo: https://github.com/facebookresearch/sapiens2
TODO before merge
config.layer_norm_epsandconfig.apply_layernormOpen PRs on the hub:
Code Agent Policy
The Transformers repo is currently being overwhelmed by a large number of PRs and issue comments written by
code agents. We are currently bottlenecked by our ability to review and respond to them. As a result,
we ask that new users do not submit pure code agent PRs at this time.
You may use code agents in drafting or to help you diagnose issues. We'd also ask autonomous "OpenClaw"-like agents
not to open any PRs or issues for the moment.
PRs that appear to be fully agent-written will probably be closed without review, and we may block users who do this
repeatedly or maliciously.
This is a rapidly-evolving situation that's causing significant shockwaves in the open-source community. As a result,
this policy is likely to be updated regularly in the near future. For more information, please read
CONTRIBUTING.md.Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.