parameters: (self, images_windows)
return_statement: return detections
docstring: Do windowed detection over given images and windows. Windows are
          extracted then warped to the input dimensions of the net.
  
          Parameters
          ----------
          images_windows: (image filename, window list) iterable.
          context_crop: size of context border to crop in pixels.
  
          Returns
          -------
          detections: list of {filename: image filename, window: crop coordinates,
              predictions: prediction vector} dicts.
docstring_summary: Do windowed detection over given images and windows. Windows are
          extracted then warped to the input dimensions of the net.
docstring_tokens: Do windowed detection over given images and windows . Windows are extracted then warped to the input dimensions of the net .
function: def detect_windows(self, images_windows):
          """
          Do windowed detection over given images and windows. Windows are
          extracted then warped to the input dimensions of the net.
  
          Parameters
          ----------
          images_windows: (image filename, window list) iterable.
          context_crop: size of context border to crop in pixels.
  
          Returns
          -------
          detections: list of {filename: image filename, window: crop coordinates,
              predictions: prediction vector} dicts.
          """
          # Extract windows.
          window_inputs = []
          for image_fname, windows in images_windows:
              image = caffe.io.load_image(image_fname).astype(np.float32)
              for window in windows:
                  window_inputs.append(self.crop(image, window))
  
          # Run through the net (warping windows to input dimensions).
          in_ = self.inputs[0]
          caffe_in = np.zeros((len(window_inputs), window_inputs[0].shape[2])
                              + self.blobs[in_].data.shape[2:],
                              dtype=np.float32)
          for ix, window_in in enumerate(window_inputs):
              caffe_in[ix] = self.transformer.preprocess(in_, window_in)
          out = self.forward_all(**{in_: caffe_in})
          predictions = out[self.outputs[0]]
  
          # Package predictions with images and windows.
          detections = []
          ix = 0
          for image_fname, windows in images_windows:
              for window in windows:
                  detections.append({
                      'window': window,
                      'prediction': predictions[ix],
                      'filename': image_fname
                  })
                  ix += 1
          return detections
function_tokens: def detect_windows ( self , images_windows ) : # Extract windows. window_inputs = [ ] for image_fname , windows in images_windows : image = caffe . io . load_image ( image_fname ) . astype ( np . float32 ) for window in windows : window_inputs . append ( self . crop ( image , window ) ) # Run through the net (warping windows to input dimensions). in_ = self . inputs [ 0 ] caffe_in = np . zeros ( ( len ( window_inputs ) , window_inputs [ 0 ] . shape [ 2 ] ) + self . blobs [ in_ ] . data . shape [ 2 : ] , dtype = np . float32 ) for ix , window_in in enumerate ( window_inputs ) : caffe_in [ ix ] = self . transformer . preprocess ( in_ , window_in ) out = self . forward_all ( * * { in_ : caffe_in } ) predictions = out [ self . outputs [ 0 ] ] # Package predictions with images and windows. detections = [ ] ix = 0 for image_fname , windows in images_windows : for window in windows : detections . append ( { 'window' : window , 'prediction' : predictions [ ix ] , 'filename' : image_fname } ) ix += 1 return detections