public void setData(final byte[] data) {
    buffers.setImage(data);
    try {
      for (ImageProcessor imageProcessor : pipeline) {
        imageProcessor.process(buffers);
      }

      if (overlay != null) {
        final Bitmap overlayBitmap = buffers.createOverlayBitmap();
        if (overlayBitmap != null) {
          overlay.post(
              new Runnable() {
                @Override
                public void run() {

                  overlay.setImageBitmap(overlayBitmap);
                }
              });
        }
      }
    } catch (Exception e) {
      Log.e("Detector", e.getMessage(), e);
    }
  }
 private void createSettings() {
   settings.clear();
   for (ImageProcessor imageProcessor : pipeline) {
     imageProcessor.getSettings(settings);
   }
 }