class_docstr: This class implements a model-specific object detector using Faster-RCNN and TensorFlow.
class_docstr_tok: ["This","class","implements","a","model-specific","object","detector","using","Faster-RCNN","and","TensorFlow","."]
docstr: Compute the loss.
  
  :param x: Sample input with shape as expected by the model.
  :param y: Target values (class labels) one-hot-encoded of shape `(nb_samples, nb_classes)` or indices
            of shape `(nb_samples,)`.
  :return: Array of losses of the same shape as `x`.
docstr_tok: ["Compute","the","loss",".",":","param","x",":","Sample","input","with","shape","as","expected","by","the","model",".",":","param","y",":","Target","values","(","class","labels",")","one-hot-encoded","of","shape","`","(","nb_samples",",","nb_classes",")","`","or","indices","of","shape","`","(","nb_samples",",",")","`",".",":","return",":","Array","of","losses","of","the","same","shape","as","`","x","`","."]
code: def compute_loss(
      self, x: np.ndarray, y: np.ndarray, **kwargs
  ) -> np.ndarray:
      """
      Compute the loss.
  
      :param x: Sample input with shape as expected by the model.
      :param y: Target values (class labels) one-hot-encoded of shape `(nb_samples, nb_classes)` or indices
                of shape `(nb_samples,)`.
      :return: Array of losses of the same shape as `x`.
      """
      # Apply preprocessing
      x_preprocessed, _ = self._apply_preprocessing(
          x, y=None, fit=False
      )
  
      # Get the losses graph
      if not hasattr(self, "_loss_total"):
          loss = None
          for loss_name in self.attack_losses:
              if loss is None:
                  loss = self._losses[loss_name]
              else:
                  loss = loss + self._losses[loss_name]
          self._loss_total = loss
  
      # Create feed_dict
      feed_dict = {self.images: x_preprocessed}
  
      for placeholder, value in zip(self._groundtruth_boxes_list, y):
          feed_dict[placeholder] = value["boxes"]
  
      for placeholder, value in zip(self._groundtruth_classes_list, y):
          feed_dict[placeholder] = value["labels"]
  
      for placeholder, value in zip(self._groundtruth_weights_list, y):
          feed_dict[placeholder] = value["scores"]
  
      loss_values = self._sess.run(
          self._loss_total, feed_dict=feed_dict
      )
  
      return loss_values
  
imports: import logging
  from typing import List, Dict, Optional, Tuple, Union, TYPE_CHECKING
  import numpy
  from art.estimators.object_detection.object_detector import ObjectDetectorMixin
  from art.estimators.tensorflow import TensorFlowEstimator
  from art.utils import get_file
  from art import config
label_desc: Use image node_id 13 for calling the TensorFlowFasterRCNN obj's underlying member method code with example usage: obj.compute_loss(x, y) and returns: loss_values