Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding doc page for the object detection task #20874

Closed

Conversation

MKhalusova
Copy link
Contributor

@MKhalusova MKhalusova commented Dec 22, 2022

This is a PR for the #20805 issue.
The guide has content and working code examples for:

  • Introduction
  • Loading CPPE-5 dataset from Hub
  • Preprocessing both images and annotations. Images are augmented, annotations are reformatted to be in the format DETR expects
  • Training with Trainer
  • Evaluation
  • Inference

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Dec 22, 2022

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

@MKhalusova MKhalusova changed the title [WIP] Adding doc page for the object detection task Adding doc page for the object detection task Dec 28, 2022
@MKhalusova
Copy link
Contributor Author

If I missed someone who has to be invited as a reviewer, please feel free to add them.

@sayakpaul
Copy link
Member

sayakpaul commented Dec 28, 2022

@MKhalusova thanks for doing this! I will take a look tomorrow my time.

I think you can follow the instructions noted here to resolve the quality bug in the CI. Let me know if anything's unclear.

MKhalusova and others added 15 commits December 28, 2022 09:24
* Fix incorrect import for the base optimizer for AdamWeightDecay

* Fix incorrect import for the base optimizer for AdamWeightDecay
remove unused use_cache in config classes

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
…gface#20279)

* Add support for binary segmentation

* Fix loss calculation and add test

* Remove space

* use fstring

Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
Co-authored-by: Niels Rogge <nielsrogge@Nielss-MBP.localdomain>
* clarify use_fast parameter

* make style

* remove check frameworks, apply review
* [S2T, Whisper] Add copied from statements

* rebase and fix-copies
* embed circle packing chart

* trim whitespace from bottom

* explain bubble sizes
* add new model like

* add v1

* v1

* v1

* vision encoder logits match

* v2

* fix

* add docstring

* CI tests pass

* fix tests

* make fixup

* add to `toctree`

* fix processors

* fix processors

* fix doc

* fill title

* add content doc

* remove from tokenization auto

* fix config

* change order

* add `# Copied from`

* few fixes

- add correct license on modeling text
- remove dummy argument

* Apply suggestions from code review

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* replace name

* refactor a bit

* more refactor

* remove unused arg

* make fixup + remove some `# Adapted from ...`

* Apply suggestions from code review

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* more `# Copied from`

* Apply suggestions from code review

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* now `generate` supports no prefix

* remove `FeatureExtractor`

* fix path

* correct dependency

* fix tests

* few fixes

* add integration tests

* add correct conversion script

* Apply suggestions from code review

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

* add `blip` to tokenization auto

* fix docstrings

* fix test + add image

* remove processor from uncorrect place

* Apply suggestions from code review

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* clean up a bit

* Apply suggestions from code review

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* clean pixel mask

* clean pixel mask

* fix `F`

* Update src/transformers/models/blip/modeling_blip.py

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* fix output

* Apply suggestions from code review

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* fix pad token id

* remove `token_type_ids`

* make fixup

* Apply suggestions from code review

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* make fixup

* Apply suggestions from code review

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* add comments

* Update src/transformers/models/blip/modeling_blip.py

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* remove `token_type_ids`

* make fixup

* better name

* replace with `image_attention_mask`

* refactor

* make fixup

* better docstring

* replace `answer_xx`

* remove ununsed args

* add `labels`

* add `labels`

* fix processing tests

* make fixup

* make fixup

* put correct repo

* remove `pad`

* remove `crop` and `center_crop`

* Update src/transformers/models/blip/image_processing_blip.py

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* fix

* remove `size_divisor`

* fix weights `init`

* remove unneeded functions

* add suggestions

* minor changes

- change slow test output for PT 1.13
- docstring order

* replace `feature_extractor` by `image_processor`

* fix doctests

* fix weight init order + add fp16 slow test

* add `blip` to doctest

* add correct repo name and fix test

* Update src/transformers/models/blip/processing_blip.py

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>

* fix tests

* use `convert_to_rgb` from `image_transforms`

* make fixup

* fix large loading issue

Co-authored-by: NielsRogge <48327001+NielsRogge@users.noreply.github.com>
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* Fix doc tests

* Use Auto API

* Apply suggestion

* Revert "Apply suggestion"

This reverts commit cd9507a.

Co-authored-by: Niels Rogge <nielsrogge@Nielss-MacBook-Pro.local>
Co-authored-by: Niels Rogge <nielsrogge@Nielss-MBP.localdomain>
Update big table

Co-authored-by: Niels Rogge <nielsrogge@Nielss-MBP.localdomain>
)

Use config.num_channels in CLIP-like modeling files

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
…on (huggingface#20621)

* fix past_key_values in GPTNeoXForCausalLM.prepare_inputs_for_generation

* fix formatting
Adds visual_prompt argument to CLIPSegProcessor to enable image-guided segmentation
…books (huggingface#20850)

Adding `evaluate` to the list of libraries to be installed for every generated notebook in transformers
…ace#20859)

* Fix past CI

* Fix past CI

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
younesbelkada and others added 16 commits December 28, 2022 09:37
poolformer onnx

Co-authored-by: syed <syed.abdul@sandlogic.com>
* Supporting `fp16` for asr pipeline

* Adding test.

* Style.

* Oops.

* Flake8 update ?

* Fixing flake8 ?

* Revert "Flake8 update ?"

This reverts commit 0b917fc.

* Style (acctidentally deleted flake8 F401.)

* Move to a bigger test (no small whisper model, and s2t doesn't seem to
accept torch_dtype=fp16).

Also we need to use a GPU to actually compute on fp16.

* Using BatchFeature capability.
…uggingface#20801)

* Add script to convert T5X T5 (v1.0 and v1.1) checkpoints to PyTorch

* Remove unnecessary check and update docstring

* Format docstring

* Fix whitespace in docstring
* add japanese translation of template

* fix japanese translation

- fix special cases
- fix typos
- manually translate special cases

Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>

Co-authored-by: Arthur <48595927+ArthurZucker@users.noreply.github.com>
* fix fp16 loading issue

* add backward compatibility

* better refactor

* better readability

- remove `force_upcast_dtype` as it is used once
- use `inspect`
- add `TODO`
* torch.jit._state

* Fix past CI

* Fix for perceiver

* Fix REALM

* Fix for Bloom

* Fix for SwinMode

* Fix for TrajectoryTransformerModel

* Fix for test_wav2vec2_with_lm

* make style

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
…ggingface#20837)

* Avoid collisions in writing metrics via 2 APIs - azureml + mlflow

MLflow tracking API is enabled by default in AzureML and HF MLflow integration is more fully featured. I'd remove the AzureML integration but leaving the current behavior for backwards compatibility (though it should really be removed)

* Trigger CI
@MKhalusova
Copy link
Contributor Author

Did a rebase in an attempt to fix the CI issue. Accidentally added a whole bunch of unrelated commits to the PR. Figuring out how to remove them.

@sayakpaul
Copy link
Member

Did a rebase in an attempt to fix the CI issue. Accidentally added a whole bunch of unrelated commits to the PR. Figuring out how to remove them.

You might want to revert to the previous commit. This thread might be helpful in that regard. And then from there:

  • Create a separate Python virtual environment.
  • Make sure you're in the virtual environment you just created and then from the transformers directory root run pip install -e .[quality].
  • Now, once the dependencies have been installed to the new virtual environment, run make style.

This should likely fix it. Since the code quality errors were previously coming from a doc page (c.f. https://app.circleci.com/pipelines/github/huggingface/transformers/54549/workflows/18b53122-1cc3-4c87-ad12-486853427500/jobs/657389), I suspect this to be stemming from the task page we're adding in this PR.

Let me know if anything is unclear.

@anton-l anton-l changed the base branch from main to add_deformable_detr December 28, 2022 15:52
@anton-l anton-l changed the base branch from add_deformable_detr to main December 28, 2022 15:52
@MKhalusova
Copy link
Contributor Author

Closing this due to messed up rebase. The new PR is now here #20925

@MKhalusova MKhalusova closed this Dec 28, 2022
@MKhalusova MKhalusova deleted the add-doc-task-obj-detection branch January 17, 2023 18:39
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.