[GroundingDino] Fix grounding dino loss 🚨 (#31828)
* Starting to fix GroundingDinoLoss and GroundingDinoHungarianMatcher
* More updates
* More updates
* fixed: GroundingDinoLoss
* fixed: failing tests
* Update src/transformers/models/grounding_dino/modeling_grounding_dino.py
Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
* Update tests/models/grounding_dino/test_modeling_grounding_dino.py
Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
* Update src/transformers/models/grounding_dino/modeling_grounding_dino.py
Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
* Update src/transformers/models/grounding_dino/modeling_grounding_dino.py
Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
* Update src/transformers/models/grounding_dino/modeling_grounding_dino.py
Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
* Update src/transformers/models/grounding_dino/modeling_grounding_dino.py
Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
* Update src/transformers/models/grounding_dino/modeling_grounding_dino.py
Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
* Update src/transformers/models/grounding_dino/modeling_grounding_dino.py
Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
* Update src/transformers/models/grounding_dino/modeling_grounding_dino.py
Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
* Update src/transformers/models/grounding_dino/modeling_grounding_dino.py
Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
* Addressed comments
* Update src/transformers/models/grounding_dino/modeling_grounding_dino.py
Co-authored-by: Sangbum Daniel Choi <34004152+SangbumChoi@users.noreply.github.com>
* add: cardinality loss and make box loss as copy from
* change: default for reduction loss is sum
* fix: vectorized generate fake box
* fix copies
* Addressed comments
* addressed comments
* addressed one-hot
* Update tests/models/grounding_dino/test_modeling_grounding_dino.py
Co-authored-by: Sangbum Daniel Choi <34004152+SangbumChoi@users.noreply.github.com>
* Addressed comments
* fixed test
* Update src/transformers/models/grounding_dino/modeling_grounding_dino.py
* Update tests/models/grounding_dino/test_modeling_grounding_dino.py
Co-authored-by: Pavel Iakubovskii <qubvel@gmail.com>
* Starting to fix GroundingDinoLoss and GroundingDinoHungarianMatcher
* More updates
* More updates
* fixed: GroundingDinoLoss
* add: cardinality loss and make box loss as copy from
* fix copies
* Revert "Update tests/models/grounding_dino/test_modeling_grounding_dino.py"
This reverts commit aa74c4c57c430e54cc74c414d6269edb65c73e83.
* [run-slow] groundigdino
* remove nestedtensor
* [run-slow] groundig_dino
* [run-slow] grounding_dino
* [run-slow] grounding_dino
* [run-slow] grounding_dino
* check
* check
* add: enconder intermediate outputs to ImageLoss forward
* add: GroundingDinoForObjectDetectionLoss in the loss directory
* make style
* fix the loss function
* remove class_reduction since it sum is default
* remove class_reduction
* Update src/transformers/loss/loss_grounding_dino.py
Co-authored-by: Pavel Iakubovskii <qubvel@gmail.com>
* simple fix
* Update src/transformers/loss/loss_grounding_dino.py
Co-authored-by: Pavel Iakubovskii <qubvel@gmail.com>
* minor fix
* Update src/transformers/loss/loss_for_object_detection.py
---------
Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
Co-authored-by: Sangbum Daniel Choi <34004152+SangbumChoi@users.noreply.github.com>
Co-authored-by: Pavel Iakubovskii <qubvel@gmail.com>
Co-authored-by: sangbumchoi <danielsejong55@gmail.com>
Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>