transformers/docs/source/en
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
..
internal TF: GPT2 with native embedding layers (#23436) 2023-05-18 14:46:40 +01:00
main_classes Add local agent (#23438) 2023-05-18 11:09:55 -04:00
model_doc TF port of the Segment Anything Model (SAM) (#22970) 2023-05-19 14:14:13 +01:00
tasks Add swiftformer (#22686) 2023-05-12 11:52:31 +01:00
_config.py
_toctree.yml Add swiftformer (#22686) 2023-05-12 11:52:31 +01:00
accelerate.mdx
add_new_model.mdx docs: Fix broken link in 'How to add a model...' (#23216) 2023-05-08 14:56:42 -04:00
add_new_pipeline.mdx
add_tensorflow_model.mdx Make it easier to develop without a dev install (#22697) 2023-04-11 08:41:53 -04:00
attention.mdx Refactor model summary (#21408) 2023-02-15 10:35:14 -08:00
autoclass_tutorial.mdx
benchmarks.mdx
bertology.mdx update: bertology paper (#22012) 2023-03-08 07:54:30 -05:00
big_models.mdx
community.mdx Fix en documentation typos (#21799) 2023-02-27 08:36:36 +01:00
contributing.md
create_a_model.mdx
custom_models.mdx
custom_tools.mdx Fix typo in gradio-tools docs (#23305) 2023-05-11 14:31:28 -04:00
debugging.mdx
fast_tokenizers.mdx
generation_strategies.mdx Docs: add link to assisted generation blog post (#23397) 2023-05-16 18:54:34 +01:00
glossary.mdx docs: New terms and updates to glossary (#21982) 2023-03-13 19:09:37 -04:00
hpo_train.mdx
index.mdx TF port of the Segment Anything Model (SAM) (#22970) 2023-05-19 14:14:13 +01:00
installation.mdx Can't install tf2 on M1 Chip by default (#22046) 2023-03-09 07:44:58 -05:00
model_sharing.mdx Fix PushToHubCallback import in Share a model docs (#21457) 2023-02-06 09:26:22 -05:00
model_summary.mdx Refactor model summary (#21408) 2023-02-15 10:35:14 -08:00
multilingual.mdx
notebooks.md
pad_truncation.mdx Example of pad_to_multiple_of for padding and truncation guide & docstring update (#22278) 2023-03-20 14:18:55 -04:00
perf_hardware.mdx
perf_infer_cpu.mdx
perf_infer_gpu_many.mdx
perf_infer_gpu_one.mdx Add methods to PreTrainedModel to use PyTorch's BetterTransformer (#21259) 2023-04-27 11:03:42 +02:00
perf_infer_special.mdx
perf_train_cpu_many.mdx Depricate xpu_backend for ddp_backend (#23085) 2023-05-01 09:44:47 -04:00
perf_train_cpu.mdx Add perf numbers for perf_train_cpu (#20974) 2023-02-06 09:20:43 -05:00
perf_train_gpu_many.mdx Remove typo in perf_train_gpu_many.mdx (#23144) 2023-05-04 09:56:45 -04:00
perf_train_gpu_one.mdx Add methods to PreTrainedModel to use PyTorch's BetterTransformer (#21259) 2023-04-27 11:03:42 +02:00
perf_train_special.mdx
perf_train_tpu_tf.mdx Typos/fixes to link syntax (#21450) 2023-02-07 15:19:19 +00:00
perf_train_tpu.mdx
performance.mdx
perplexity.mdx Fix bug in perplexity guide calculations and update perplexity numbers. Fixes #22348 (#22411) 2023-03-28 09:09:17 -04:00
philosophy.mdx
pipeline_tutorial.mdx Modify pipeline_tutorial.mdx (#22726) 2023-04-12 15:20:25 +01:00
pipeline_webserver.mdx Update quality tooling for formatting (#21480) 2023-02-06 18:10:56 -05:00
pr_checks.mdx Make it easier to develop without a dev install (#22697) 2023-04-11 08:41:53 -04:00
preprocessing.mdx fix spelling error (#23143) 2023-05-04 09:56:28 -04:00
quicktour.mdx Fix TF example in quicktour (#22960) 2023-04-24 17:25:13 +01:00
run_scripts.mdx
sagemaker.mdx
serialization.mdx Add swiftformer (#22686) 2023-05-12 11:52:31 +01:00
task_summary.mdx Remove trailing 'extractive' word from en documentation (#21594) 2023-02-13 10:09:00 -05:00
tasks_explained.mdx
testing.mdx Bring back the PR Refactor doctests + add CI to main (#23271) 2023-05-10 22:00:48 +02:00
tf_xla.mdx
tokenizer_summary.mdx
torchscript.mdx 🌐 [i18n-KO] Translated torchscript.mdx to Korean (#23060) 2023-05-02 09:27:59 -04:00
training.mdx Fix TF example in quicktour (#22960) 2023-04-24 17:25:13 +01:00
transformers_agents.mdx Fix broken links in the agent docs (#23297) 2023-05-11 14:26:19 -04:00
troubleshooting.mdx Removed BLIP mention from the troubleshooting guide (#21872) 2023-03-01 08:26:25 -05:00