code: def create_and_check_conditional_detr_object_detection_head_model(
      self, config, pixel_values, pixel_mask, labels
  ):
      model = ConditionalDetrForObjectDetection(config=config)
      model.to(torch_device)
      model.eval()
  
      result = model(pixel_values=pixel_values, pixel_mask=pixel_mask)
      result = model(pixel_values)
  
      self.parent.assertEqual(
          result.logits.shape,
          (self.batch_size, self.num_queries, self.num_labels),
      )
      self.parent.assertEqual(
          result.pred_boxes.shape,
          (self.batch_size, self.num_queries, 4),
      )
  
      result = model(
          pixel_values=pixel_values,
          pixel_mask=pixel_mask,
          labels=labels,
      )
  
      self.parent.assertEqual(result.loss.shape, ())
      self.parent.assertEqual(
          result.logits.shape,
          (self.batch_size, self.num_queries, self.num_labels),
      )
      self.parent.assertEqual(
          result.pred_boxes.shape,
          (self.batch_size, self.num_queries, 4),
      )
  
imports: import inspect
  import math
  import unittest
  from transformers import ConditionalDetrConfig, is_timm_available, is_vision_available
  from transformers.testing_utils import require_timm, require_vision, slow, torch_device
  from transformers.utils import cached_property
  from ...generation.test_generation_utils import GenerationTesterMixin
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_common import ModelTesterMixin, _config_zero_init, floats_tensor
label_desc: Use image node_id 6 for calling the ConditionalDetrModelTester obj's underlying member method code with example usage: obj.create_and_check_conditional_detr_object_detection_head_model(config, pixel_values, pixel_mask, labels) without return types