From be50a0338b9d7b76448fcc9c5046a78118a4d968 Mon Sep 17 00:00:00 2001 From: Sangbum Daniel Choi <34004152+SangbumChoi@users.noreply.github.com> Date: Thu, 27 Jun 2024 20:36:55 +0900 Subject: [PATCH] change anchor_image_size None for compatibility (#31640) * change anchor_image_size None for compatibility * make fix-copies --- src/transformers/models/rt_detr/configuration_rt_detr.py | 6 +++--- tests/models/rt_detr/test_modeling_rt_detr.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/transformers/models/rt_detr/configuration_rt_detr.py b/src/transformers/models/rt_detr/configuration_rt_detr.py index a3d49fafea..d0f4bb1756 100644 --- a/src/transformers/models/rt_detr/configuration_rt_detr.py +++ b/src/transformers/models/rt_detr/configuration_rt_detr.py @@ -118,8 +118,8 @@ class RTDetrConfig(PretrainedConfig): Scale or magnitude of noise to be added to the bounding boxes. learn_initial_query (`bool`, *optional*, defaults to `False`): Indicates whether the initial query embeddings for the decoder should be learned during training - anchor_image_size (`Tuple[int, int]`, *optional*, defaults to `[640, 640]`): - Height and width of the input image used during evaluation to generate the bounding box anchors. + anchor_image_size (`Tuple[int, int]`, *optional*): + Height and width of the input image used during evaluation to generate the bounding box anchors. If None, automatic generate anchor is applied. disable_custom_kernels (`bool`, *optional*, defaults to `True`): Whether to disable custom kernels. with_box_refine (`bool`, *optional*, defaults to `True`): @@ -218,7 +218,7 @@ class RTDetrConfig(PretrainedConfig): label_noise_ratio=0.5, box_noise_scale=1.0, learn_initial_query=False, - anchor_image_size=[640, 640], + anchor_image_size=None, disable_custom_kernels=True, with_box_refine=True, is_encoder_decoder=True, diff --git a/tests/models/rt_detr/test_modeling_rt_detr.py b/tests/models/rt_detr/test_modeling_rt_detr.py index 44647be5ac..2d3d48dba3 100644 --- a/tests/models/rt_detr/test_modeling_rt_detr.py +++ b/tests/models/rt_detr/test_modeling_rt_detr.py @@ -91,7 +91,7 @@ class RTDetrModelTester: label_noise_ratio=0.5, box_noise_scale=1.0, learn_initial_query=False, - anchor_image_size=[64, 64], + anchor_image_size=None, image_size=64, disable_custom_kernels=True, with_box_refine=True,