transformers/tests
Nicolas Patry 8e777b3ba4
[Proposal] Breaking change zero-shot-object-detection for improved consistency. (#20280)
* [Proposal] Breaking change `zero-shot-object-detection` for improved
consistency.

This is a proposal to modify the output of `zero-shot-object-detection`
to provide better alignment with other pipelines.

The output is now strictly the same as `object-detection` whereas before
it would output lists of lists.

The name `candidate_labels` is used throughout for consistency with
other `zero-shot` pipelines.

The pipeline is changed to `ChunkPipeline` to support batching cleanly.

This removes all the lists and list of lists shenanigans, it's now a
matter of the base pipeline handling all this not this specific one.

**Breaking change**: It did remove complex calls potentials `pipe(images = [image1, image2],
text_queries=[candidates1, candidates2])` to support only
`pipe([{"image": image1, "candidate_labels": candidates1}, {"image": image2, "candidate_labels": candidates2}])`
when dealing with lists and/or datasets.
We could keep them, but it will add a lot of complexity to the code
base, since the pipeline is rather young, I'd rather break to keep the
code simpler, but we can revert this.

**Breaking change**: The name of the argument is now `image` instead of
`images` since it expects by default only 1 image. This is revertable
like the previous one.

**Breaking change**: The types is now simplified and flattened:

`pipe(inputs) == [{**object1}, {**object2}]`
instead of the previous
`pipe(inputs) == [[{**object1}, {**object1}], [{**object2}]]`
Where the different instances would be grouped by candidate labels
within lists.
IMHO this is not really desirable, since it would output empty lists and
is only adding superflous indirection compared to
`zero-shot-object-detection`.

It is relatively change free in terms of how the results, it does change
computation however since now the batching is handled by the pipeline
itself. It **did** change the results for the small models so there
seems to be a real difference in how the models handle this.

* Fixing the doctests.

* Behind is_torch_available.
2022-11-18 15:57:28 +01:00
..
benchmark [Test refactor 1/5] Per-folder tests reorganization (#15725) 2022-02-23 15:46:28 -05:00
deepspeed Fix tapas scatter (#20149) 2022-11-14 01:04:26 -05:00
extended Update self-push workflow (#17177) 2022-05-13 16:28:00 +02:00
fixtures add a warning in SpmConverter for sentencepiece's model using the byte fallback feature (#16629) 2022-04-11 11:06:10 +02:00
generation Generate: add Bloom fixes for contrastive search (#20213) 2022-11-14 18:34:11 +00:00
mixed_int8 refactor test (#20300) 2022-11-17 15:59:22 +01:00
models Add AutoBackbone + ResNetBackbone (#20229) 2022-11-17 15:43:20 +01:00
onnx add MobileNetV2 model (#17845) 2022-11-14 01:00:10 -05:00
optimization [Test refactor 1/5] Per-folder tests reorganization (#15725) 2022-02-23 15:46:28 -05:00
pipelines [Proposal] Breaking change zero-shot-object-detection for improved consistency. (#20280) 2022-11-18 15:57:28 +01:00
repo_utils Repo utils test (#19696) 2022-10-18 13:47:36 -04:00
sagemaker transformers-cli login => huggingface-cli login (#18490) 2022-08-06 09:42:55 +02:00
tokenization fix train_new_from_iterator in the case of byte-level tokenizers (#17549) 2022-06-08 15:30:41 +02:00
trainer Add AnyPrecisionAdamW optimizer (#18961) 2022-11-18 09:27:08 -05:00
utils Add Image Processors (#19796) 2022-11-02 11:57:36 +00:00
__init__.py GPU text generation: mMoved the encoded_prompt to correct device 2020-01-06 15:11:12 +01:00
test_configuration_common.py Add WhisperModel to transformers (#19166) 2022-10-05 22:28:31 +02:00
test_feature_extraction_common.py Add tests for legacy load by url and fix bugs (#19078) 2022-09-16 23:20:02 +02:00
test_image_transforms.py Add padding image transformation (#19838) 2022-11-18 11:27:21 +00:00
test_modeling_common.py mark test_save_load_fast_init_from_base as is_flaky (#20200) 2022-11-14 18:51:33 +01:00
test_modeling_flax_common.py Allow flax subfolder (#19902) 2022-10-26 18:33:23 +02:00
test_modeling_tf_common.py Generate: general TF XLA constrastive search are now slow tests (#20277) 2022-11-17 12:34:46 +00:00
test_sequence_feature_extraction_common.py Some tests misusing assertTrue for comparisons fix (#16771) 2022-04-19 14:44:08 +02:00
test_tokenization_common.py 🚨 🚨 🚨 Fix Issue 15003: SentencePiece Tokenizers Not Adding Special Tokens in convert_tokens_to_string (#15775) 2022-11-02 15:45:38 -04:00