Skip to content

SuperPointModel -> SuperPointForKeypointDetection#29757

Merged
amyeroberts merged 1 commit intohuggingface:mainfrom
amyeroberts:superpoint-keypoint-detection-class
Mar 20, 2024
Merged

SuperPointModel -> SuperPointForKeypointDetection#29757
amyeroberts merged 1 commit intohuggingface:mainfrom
amyeroberts:superpoint-keypoint-detection-class

Conversation

@amyeroberts
Copy link
Contributor

@amyeroberts amyeroberts commented Mar 20, 2024

What does this PR do?

Renames SuperPointModel to SuperPointForKeypointDetection and adds AutoModelForKeypointDetection. This is more in-line with our library's pattern, where AutoModel returns a base model and AutoModelForXxx will return task specific outputs.

Originally I had requested this, as the model doesn't have an obvious task-specific head on-top. @NielsRogge highlighted the discrepancy and it was agreed offline using the task-specific class was better.

There is currently no SuperPointModel class, but we can add this later if needed

Fixes # (issue)

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

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.

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

Thanks 😃

@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.

@amyeroberts amyeroberts merged commit 3c17c52 into huggingface:main Mar 20, 2024
@amyeroberts amyeroberts deleted the superpoint-keypoint-detection-class branch March 20, 2024 15:41
@amyeroberts
Copy link
Contributor Author

cc @sbucaille As you're working on adding SuperGlue - and apologies for my previous bad advise to just use AutoModel!

@NielsRogge
Copy link
Contributor

NielsRogge commented Mar 20, 2024

Thanks @amyeroberts for the quick fix - one minor remark is that I would've waited with adding an AutoModelForKeypointDetection class before we have at least 2 keypoint detection models, in order to unify their APIs. This is because Auto classes define a certain standard API which all classes that belong to that mapping should respect.

@amyeroberts
Copy link
Contributor Author

Yes, but in this case it's needed for the SuperGlue implementation

@NielsRogge
Copy link
Contributor

Could you clarify why it's needed? Models can be added to the "not auto mapped" list and eventually be added to an auto class

@amyeroberts
Copy link
Contributor Author

Because we need an auto model to be used within the modeling file for SuperPoint, similar to what we do in llava

@sbucaille
Copy link
Contributor

@amyeroberts I was exactly about to point the problem I would reach with SuperGlue, since it uses the outputs of models like SuperPoint (keypoints data) and not images (pixel_values). But we will be able to discuss this in the appropriate PR (btw you can reopen it as I'll push new changes in the coming days). Anyway thanks for the anticipation ! 🤗

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.

5 participants