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

Update to support new from_transformers methods #1113

Open
LinasKo opened this issue Apr 12, 2024 · 1 comment
Open

Update to support new from_transformers methods #1113

LinasKo opened this issue Apr 12, 2024 · 1 comment

Comments

@LinasKo
Copy link
Collaborator

LinasKo commented Apr 12, 2024

Description

(Draft)

Supervision contains the function from_transformers that includes the results of a Hugging Face transformer and converts it into Detections.

Up until now, we were recommending users to call one of two transformers functions:

  1. post_process_segmentation for any segmentation task
  2. post_process for detection.

Reading through the code of transformers, it appears both are being deprecated and will be removed in version 5. At the time of writing, the latest is v4.39.3, with the first v4 release in late 2020.

Let's make sure we support the new version! Detections object is universal - it can contain both masks and segmentation. Let's change the from_tensors method so it checks its inputs, determines which function was called formats the output, and builds the Detections object like we're doing now.

More specific details to come

Additional

  • Note: Please share a Google Colab with minimal code to test the new feature. We know it's additional work, but it will speed up the review process. The reviewer must test each change. Setting up a local environment to do this is time-consuming. Please ensure that Google Colab can be accessed without any issues (make it public). Thank you! 🙏🏻
@LinasKo
Copy link
Collaborator Author

LinasKo commented Apr 12, 2024

You can find examples of the new and old function calls in this Colab

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