How to reshape a tensor image in android java sdk from channel first to channel last?

I need to run inference on a channel first tflite model(input shape - 1,3,256,256) but the image to feed have (1,256,256,3). Not able to find a solution for that.

I don’t believe TF Lite offers an API for that purpose. You may want to consider using another library like OpenCV, but it’s also pretty easy to perform this kind of operation manually with, for example, JavaCPP Indexers: Bytedeco - Third release at Bytedeco

1 Like

You can open a request at:

Created a issue.

1 Like