I am refactoring my codebase so that I can use MLImage for all the models that I am using (MLKit PoseDetection and a custom detection model TFLite). This was a success, however, I noticed that Google just introduced MlImageAdapter that basically converts an MLimage to TensorImage as the Tflite model requires the image in TensorImage format.
A code snippet from one of their latest commits is below:
public List<Detection> detect(MlImage image, ImageProcessingOptions options) {
image.getInternal().acquire();
TensorImage tensorImage = MlImageAdapter.createTensorImageFrom(image);
List<Detection> result = detect(tensorImage, options);
image.close();
return result;
}
indent preformatted text by 4 spaces
But as I try to use MlImageAdapter in my code base, it is unable to import it. And the dependencies in their BUILD file is puzzling for me and so I cannot add relevant dependencies in gradle file.
The link is below:
Any help would be awesome. Thanks!!!