     // Resize the input to 416x416 and give it to our model.
     if let boundingBoxes = try? yolo.predict(image: resizedPixelBuffer) {
       let elapsed = CACurrentMediaTime() - startTime
-
-      DispatchQueue.main.async {
-        // For debugging, to make sure the resized CVPixelBuffer is correct.
-        //var debugImage: CGImage?
-        //VTCreateCGImageFromCVPixelBuffer(resizedPixelBuffer, nil, &debugImage)
-        //self.debugImageView.image = UIImage(cgImage: debugImage!)
-
-        self.show(predictions: boundingBoxes)
-        self.timeLabel.text = String(format: "Elapsed %.5f seconds (%.2f FPS)", elapsed, 1/elapsed)
-      }
+      showOnMainThread(boundingBoxes, elapsed)
     }
   }
 
   func predictUsingVision(pixelBuffer: CVPixelBuffer) {
-    // TODO: This ought to work but the request contains no results!
-    // For some reason Vision does not understand it needs to return
-    // a VNCoreMLFeatureValueObservation object.
+    // Measure how long it takes to predict a single video frame.
+    startTime = CACurrentMediaTime()
+
+    // Vision will automatically resize the input image.
     let handler = VNImageRequestHandler(cvPixelBuffer: pixelBuffer)
     try? handler.perform([request])
   }
 
   func visionRequestDidComplete(request: VNRequest, error: Error?) {
-    if let observations = request.results as? [VNCoreMLFeatureValueObservation] {
-      print(observations.count)
-
-      DispatchQueue.main.async {
-        // TODO: show the results
-      }
+    if let observations = request.results as? [VNCoreMLFeatureValueObservation],
+       let features = observations.first?.featureValue.multiArrayValue {
+
+      let boundingBoxes = yolo.computeBoundingBoxes(features: features)
+      let elapsed = CACurrentMediaTime() - startTime
+      showOnMainThread(boundingBoxes, elapsed)
+    }
+  }
+
+  func showOnMainThread(_ boundingBoxes: [YOLO.Prediction], _ elapsed: CFTimeInterval) {
+    DispatchQueue.main.async {
+      // For debugging, to make sure the resized CVPixelBuffer is correct.
+      //var debugImage: CGImage?
+      //VTCreateCGImageFromCVPixelBuffer(resizedPixelBuffer, nil, &debugImage)
+      //self.debugImageView.image = UIImage(cgImage: debugImage!)
+
+      self.show(predictions: boundingBoxes)
+      self.timeLabel.text = String(format: "Elapsed %.5f seconds (%.2f FPS)", elapsed, 1/elapsed)
     }
   }
 


    // Perform the prediction on VideoCapture's queue.
    if let pixelBuffer = pixelBuffer {
      predict(pixelBuffer: pixelBuffer)
      //predictUsingVision(pixelBuffer: pixelBuffer)
    }
  }
}

        // and bottom.
        let width = view.bounds.width
        let height = width * 4 / 3
        let scaleX = width / CGFloat(YOLO.inputWidth)
        let scaleY = height / CGFloat(YOLO.inputHeight)
        let top = (view.bounds.height - height) / 2

        // Translate and scale the rectangle to our own coordinate system.
