code: public INDArray asMatrix(Object image) throws IOException {
          INDArray array = null;
          if (array == null) {
              try {
                  array = new AndroidNativeImageLoader(this).asMatrix(image);
              } catch (NoClassDefFoundError e) {
                  // ignore
              }
          }
          if (array == null) {
              try {
                  array = new Java2DNativeImageLoader(this).asMatrix(image);
              } catch (NoClassDefFoundError e) {
                  // ignore
              }
          }
          return array;
      }
docs: Calls {@link AndroidNativeImageLoader#asMatrix(android.graphics.Bitmap)} or
  {@link Java2DNativeImageLoader#asMatrix(java.awt.image.BufferedImage)}.
  @param image as a {@link android.graphics.Bitmap} or {@link java.awt.image.BufferedImage}
  @return the matrix or null for unsupported object classes
  @throws IOException