Skip to content

[SAM] fix sam slow test#23376

Merged
younesbelkada merged 3 commits intohuggingface:mainfrom
younesbelkada:dix-sam
May 17, 2023
Merged

[SAM] fix sam slow test#23376
younesbelkada merged 3 commits intohuggingface:mainfrom
younesbelkada:dix-sam

Conversation

@younesbelkada
Copy link
Contributor

@younesbelkada younesbelkada commented May 15, 2023

What does this PR do?

This PR fixes the slow tests that were failing due to #23295

In fact, in the slow test that we have designed, we forgot to use the correct format for the input bounding boxes

Will address a PR on notebooks to address the changes in the example notebook

cc @ydshieh @amyeroberts

@younesbelkada younesbelkada changed the title [`SAMfix sam slow test [SAM] fix sam slow test May 15, 2023
@younesbelkada
Copy link
Contributor Author

Fix for the notebook: huggingface/notebooks#371

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented May 15, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Collaborator

@ydshieh ydshieh left a comment

Choose a reason for hiding this comment

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

Thanks!

Copy link
Contributor

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

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

Thanks for fixing! Good to see type of boxes and points now consistent.

Before merging, so that I understand the consequences - how did the slow tests run before? As I understand it, the tests are now failing because of the assertions being raised based on input type checks. However, the previous inputs were still being successfully processed i.e. the test would run without issue and produce the same results. If this is the case - do we need the logic checks from #23295?

As an additional side note, I just noticed the exception messages should be updated - you can't have floating integers :)

@younesbelkada
Copy link
Contributor Author

Indeed the tests were passing before because the processor was force unsqueezeing the boxes here:

input_boxes = input_boxes.unsqueeze(1) if len(input_boxes.shape) != 3 else input_boxes

you can't have floating integers :)

Hahah yes, thanks for noticing! Copilot does some bad job sometimes ... will update that as well

Copy link
Contributor

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

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

Thanks for fixing and taking the time to explain about previously passing tests!

@younesbelkada younesbelkada merged commit 3d3c7d4 into huggingface:main May 17, 2023
@younesbelkada younesbelkada deleted the dix-sam branch May 17, 2023 12:27
@younesbelkada
Copy link
Contributor Author

Thanks a lot @amyeroberts !

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

gojiteji pushed a commit to gojiteji/transformers that referenced this pull request Jun 5, 2023
* fix sam slow test

* oops

* fix error message
novice03 pushed a commit to novice03/transformers that referenced this pull request Jun 23, 2023
* fix sam slow test

* oops

* fix error message
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