Skip to content

Update conditional logic and -> or in SAM postprocessing#23295

Merged
amyeroberts merged 1 commit into
huggingface:mainfrom
hwuebben:OR_am_i_crazy
May 12, 2023
Merged

Update conditional logic and -> or in SAM postprocessing#23295
amyeroberts merged 1 commit into
huggingface:mainfrom
hwuebben:OR_am_i_crazy

Conversation

@hwuebben

Copy link
Copy Markdown
Contributor

should be ors here

@HuggingFaceDocBuilderDev

HuggingFaceDocBuilderDev commented May 11, 2023

Copy link
Copy Markdown

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

@younesbelkada younesbelkada left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the PR, I think that it should be as it is, input_points, input_labels and input_boxes are expected to be a list of lists (or a list of lists of lists), hence the and condition

@hwuebben

Copy link
Copy Markdown
Contributor Author

@younesbelkada exactly but with the current implementation it could also be a list of arrays and the exception would not be thrown

@younesbelkada younesbelkada left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah yes, you are right, that sounds correct to me! Thanks for the heads up

@younesbelkada
younesbelkada requested a review from amyeroberts May 11, 2023 14:14

@amyeroberts amyeroberts left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the fix!

@amyeroberts
amyeroberts merged commit 65d7b21 into huggingface:main May 12, 2023
@amyeroberts amyeroberts changed the title OR am I crazy? Update conditional logic and -> or in SAM postprocessing May 12, 2023
@ydshieh

ydshieh commented May 15, 2023

Copy link
Copy Markdown
Collaborator

FYI, this PR triggered 3 test failures on the CI.

(The third one is GPU OOM, which is likely caused by the other 2 failures).

cc @younesbelkada

tests/models/sam/test_modeling_sam.py::SamModelIntegrationTest::test_inference_mask_generation_one_point_one_bb
(line 235)  ValueError: Input boxes must be a list of list of list of floating integers.
tests/models/sam/test_modeling_sam.py::SamModelIntegrationTest::test_inference_mask_generation_one_point_one_bb_zero
(line 235)  ValueError: Input boxes must be a list of list of list of floating integers.
tests/models/sam/test_modeling_sam.py::SamModelIntegrationTest::test_inference_mask_generation_two_points_batched
(line 808)  torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 2.00 GiB (GPU 0; 14.76 GiB total capacity; 11.65 GiB already allocated; 792.75 MiB free; 12.74 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation.  See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

gojiteji pushed a commit to gojiteji/transformers that referenced this pull request Jun 5, 2023
novice03 pushed a commit to novice03/transformers that referenced this pull request Jun 23, 2023
@karthikdatta98

Copy link
Copy Markdown

ValueError: Input boxes must be a list of list of list of floating integers. I AM Still getting this error, when even run the example notebooks, what do I do? I just have a list of bounding box coordinated(flatenned)

@younesbelkada

Copy link
Copy Markdown
Contributor

Hi @karthikdatta98
thanks for reporting, in huggingface/notebooks#409 I modified the notebook accordingly to show how to correctly pass bounding boxes

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.

6 participants