code: def attack_optimize(
      self, img_list, mask, logo_mask=None, resized_logo_mask=None
  ):
      s = time.time()
  
      # set fetch list
      fetch_list = [
          self.object_detector.fc_19,  # fetch_list[0] is for user interpretation
          self.attackoperator,  # controlling attack loss
          self.constrained,  # picture matrix to be reconstructed
          self.C_target,  # for interpreting attack process
          self.loss,
      ]  # for interpreting attack process
  
      # attack
      print("Adversarial attack...")
  
      inputs = np.zeros(
          (self.num_of_EOT_transforms, 448, 448, 3), dtype="float32"
      )
      inputs_mask = np.zeros((1, 448, 448, 3), dtype="float32")
      mask_resized = cv2.resize(mask, (448, 448))
      inputs_mask[0] = mask_resized
  
      # hyperparameter to control two optimization objectives
      punishment = np.array([0.01])
      smoothness_punishment = np.array([0.5])
  
      # if you want
      Target_Loss = []
      Image_Loss = []
      # np.random.shuffle(img_list)
      for i in range(self.steps):
          # prepare attack batch
          for j in range(self.num_of_EOT_transforms):
              choose = np.random.randint(len(img_list))
              # print(img_list[choose][0])
              img_with_logo = self._init_sticker_area(
                  img_list[choose][1], logo_mask, resized_logo_mask
              )
  
              img_resized = cv2.resize(img_with_logo, (448, 448))
  
              # just like np.newaxis, expanding a dimension at the front
              inputs[j] = (img_resized / 255.0) * 2.0 - 1.0
  
          # set original image and punishment
          in_dict = {
              self.x: inputs,
              self.punishment: punishment,
              self.mask: inputs_mask,
              self.smoothness_punishment: smoothness_punishment,
          }
  
          # fetch something in self(tf.Variable)
          net_output = self.sess.run(fetch_list, feed_dict=in_dict)
          print(
              f"step: {i}, Target Loss: {net_output[3]}, Image Loss: {net_output[4][0]-net_output[3]}"
          )
          Target_Loss.append(net_output[3])
          Image_Loss.append(net_output[4][0] - net_output[3])
  
          ##tmp code
          # adsticker = self._save_np_as_jpg(str(i)+'_whole_pic.jpg', net_output[2][0])
          ##
  
      strtime = str(time.time() - s)
      if self.disp_console:
          print("Elapsed time : " + strtime + " secs" + "\n")
      print("Attack finished!")
  
      result = self._interpret_output(net_output[0][0])
      self.show_results(img_with_logo, result)
  
      return net_output[2][0]
  
imports: from __future__ import division
  from __future__ import print_function
  from builtins import str
  from builtins import range
  from past.utils import old_div
  import numpy
  import cv2
  import tensorflow
  import time
  import os
  from EOT_simulation import transformation
  from attack_methods.base_logic import ODD_logic
  import pdb
label_desc: Use image node_id 4 for calling the EOTB_attack obj's underlying member method code with example usage: obj.attack_optimize(img_list, mask, logo_mask, resized_logo_mask) and returns: net_output