 
   /// Initialize Image Segmentator instance.
   fileprivate init(
+    tfLiteQueue: DispatchQueue,
     interpreter: Interpreter,
     inputShape: Tensor.Shape,
     outputShape: Tensor.Shape,

    self.inputImageHeight = inputShape.dimensions[2]
    self.inputPixelSize = inputShape.dimensions[3]

    // Read output shape from model
    self.outputImageWidth = outputShape.dimensions[1]
    self.outputImageHeight = outputShape.dimensions[2]
    self.outputClassCount = outputShape.dimensions[3]

    // Store label list
    self.labelList = labelList
  }

  // MARK: - Image Segmentation


  /// Create a new Image Segmentator instance.
  static func newInstance(completion: @escaping ((Result<ImageSegmentator>) -> Void)) {
    // Create a dispatch queue to ensure all operations on the Intepreter will run serially.
    let tfLiteQueue = DispatchQueue(label: "org.tensorflow.examples.lite.image_segmentation")

    // Run initialization in background thread to avoid UI freeze.
    tfLiteQueue.async {
      // Construct the path to the model file.
      guard
        let modelPath = Bundle.main.path(
