Files
HuggingFace_transformer/docs/source/en/model_doc
Matt 1c460a5273 TF port of the Segment Anything Model (SAM) (#22970)
* First commit

* Add auto-translation with GPT-4

* make fixup

* Add a functional layernorm for TF

* Add all the auxiliary imports etc.

* Add the extra processor and tests

* rebase to main

* Add all the needed fixes to the GPT code

* make fixup

* Make convolutions channels-last so they run on CPU

* make fixup

* Fix final issues

* Fix other models affected by test change

* Clarify comment on the sparse_prompt_embeddings check

* Refactor functional_layernorm, use shape_list in place of .shape in some places

* Remove deprecated torch-alike code

* Update tests/models/sam/test_modeling_tf_sam.py

Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>

* Update tests/models/sam/test_modeling_tf_sam.py

Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>

* Refactor processor with common methods and separated private methods

* make fixup

* Quietly delete the file that didn't do anything (sorry Sylvain)

* Refactor the processor tests into one file

* make fixup

* Clean up some unnecessary indirection

* Fix TF mask postprocessing

* Add more processor equivalence tests

* Refactor generate_crop_boxes to use framework-neutral np code

* Make the serving output correctly conditional

* Fix error message line length

* Use dict keys rather than indices internally in both TF and PT SAM call/forward

* Return dicts internally in the call/forward methods

* Revert changes to common tests and just override check_pt_tf_outputs

* Revert changes to other model tests

* Clarify comments for functional layernorm

* Add missing transpose from PT code

* Removed unused copied from in PT code

* Remove overrides for tests that don't exist in TF

* Fix transpose and update tests for PT and TF to check pred_masks

* Add training flag

* Update tests to use TF checkpoints

* Update index.mdx

* Add missing cross-test decorator

* Remove optional extra asterisks

* Revert return_dict changes in PT code

* Update src/transformers/models/sam/modeling_tf_sam.py

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* Remove None return annotations on init methods

* Update tests/models/sam/test_processor_sam.py

Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>

* Fix input_boxes shapes

* make fixup

---------

Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
2023-05-19 14:14:13 +01:00
..
2023-03-16 13:41:48 +03:00
2023-01-04 09:18:57 +01:00
2022-04-04 10:25:46 -04:00
2022-04-04 10:25:46 -04:00
2022-04-04 10:25:46 -04:00
2023-02-28 15:42:55 +01:00
2023-04-04 16:05:22 +01:00
2022-04-04 10:25:46 -04:00
2023-04-24 14:00:29 +02:00
2023-01-17 17:18:56 +01:00
2022-11-09 18:31:22 +01:00
2023-03-14 12:08:14 +03:00
2022-04-04 10:25:46 -04:00
2023-01-17 17:18:56 +01:00
2022-11-29 10:38:01 +00:00
2023-02-15 10:35:14 -08:00
2023-02-20 16:37:11 +03:00
2022-11-08 19:54:41 +00:00
2023-04-23 20:03:05 +03:00
2022-04-04 10:25:46 -04:00
2023-05-15 12:04:16 +01:00
2023-01-17 17:18:56 +01:00
2022-04-04 10:25:46 -04:00
2022-04-04 10:25:46 -04:00
2023-01-16 20:37:07 +03:00
2023-04-25 17:58:45 -04:00
2022-04-04 10:25:46 -04:00
2023-04-04 14:53:06 +02:00
2022-04-04 10:25:46 -04:00
2023-02-15 10:35:14 -08:00
2022-04-04 10:25:46 -04:00
2023-04-04 12:41:12 -04:00
2023-03-24 19:45:57 +00:00
2022-04-04 10:25:46 -04:00
2023-05-09 13:04:10 -04:00
2023-02-03 12:43:46 -05:00
2023-05-12 11:52:31 +01:00
2022-12-16 16:24:01 +01:00
2022-04-08 10:57:51 +02:00
2023-05-05 11:29:20 -04:00
2023-02-15 18:10:30 +00:00
2022-06-21 10:24:50 +02:00
2022-11-08 19:54:41 +00:00
2023-01-17 17:18:56 +01:00
2023-01-17 17:18:56 +01:00
2023-02-07 16:43:19 -05:00
2022-04-04 10:25:46 -04:00