I have made an image classification model using Keras in Python which is in ".h5" format. I am trying to use it in my Android application using Deeplearning4j.
I am facing an issue when I try to do image classification by loading a Mat image using NativeImageLoader constructor. The code is as follows :
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();
When the app builds it gives an error at the second line of the code above i.e INDArray image = nativeImageLoader.asMatrix(testImage);
I get the following error when I build the apk:
Error:(1109, 51) error: cannot access BufferedImage
class file for java.awt.image.BufferedImage not found
I tried to find the solution but this and this says that AWT package is not supported in Android.
Please help me with a solution or a work around. Thank you.