title: Deeplearning4j : Class file for java.awt.image.BufferedImage not found on Android Studio
body: <p>I have made an image classification model using Keras in Python which is in <strong>".h5"</strong> format. I am trying to use it in my Android application using Deeplearning4j.</p>
  
  <p>I am facing an issue when I try to do image classification by loading a <strong>Mat</strong> image using <a href="https://deeplearning4j.org/datavecdoc/org/datavec/image/loader/NativeImageLoader.html#asMatrix-org.bytedeco.javacpp.opencv_core.Mat-" rel="nofollow noreferrer">NativeImageLoader</a> constructor. The code is as follows :</p>
  
  <pre><code>NativeImageLoader nativeImageLoader = new NativeImageLoader(60, 60, 3);
  INDArray image = nativeImageLoader.asMatrix(testImage);   // testImage is of Mat format
  
  // 0-255 to 0-1
  DataNormalization scaler = new ImagePreProcessingScaler(0, 1);
  scaler.transform(image);
  // Pass through to neural Net
  INDArray output = model.output(image);
  INDArray labels = model.getLabels();
  </code></pre>
  
  <p>When the app builds it gives an error at the second line of the code above i.e <code>INDArray image = nativeImageLoader.asMatrix(testImage);</code></p>
  
  <p>I get the following error when I build the apk:</p>
  
  <pre><code>Error:(1109, 51) error: cannot access BufferedImage
  class file for java.awt.image.BufferedImage not found
  </code></pre>
  
  <p>I tried to find the solution but <a href="https://stackoverflow.com/a/6345814/7665986">this</a> and <a href="https://stackoverflow.com/a/33210293/7665986">this</a> says that AWT package is not supported in Android.</p>
  
  <p>Please help me with a solution or a work around. Thank you.</p>