   var colors: [UIColor] = []
 
   let ciContext = CIContext()
-  var resizedPixelBuffer: CVPixelBuffer?
+  var resizedPixelBuffers: [CVPixelBuffer?] = []
 
   var framesDone = 0
   var frameCapturingStartTime = CACurrentMediaTime()


    // Vision will automatically resize the input image.
    let handler = VNImageRequestHandler(cvPixelBuffer: pixelBuffer)
    let request = requests[inflightBuffer]

    // For better throughput, we want to schedule multiple Vision requests
    // in parllel. These need to be separate instances, and inflightBuffer
    // is the index of the current request object to use.
    inflightBuffer += 1
    if inflightBuffer >= ViewController.maxInflightBuffers {
      inflightBuffer = 0
    }

    // Because perform() will block until after the request completes, we
    // run it on a concurrent background queue, so that the next frame can

  }

  func setUpCoreImage() {
    // Since we might be running several requests in parallel, we also need
    // to do the resizing in different pixel buffers or we might overwrite a
    // pixel buffer that's already in use.
    for _ in 0..<YOLO.maxBoundingBoxes {
      var resizedPixelBuffer: CVPixelBuffer?
      let status = CVPixelBufferCreate(nil, YOLO.inputWidth, YOLO.inputHeight,
                                       kCVPixelFormatType_32BGRA, nil,
                                       &resizedPixelBuffer)

      if status != kCVReturnSuccess {
        print("Error: could not create resized pixel buffer", status)
      }
      resizedPixelBuffers.append(resizedPixelBuffer)
    }
  }

