• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Plants Detection

It is interesting for you?

  • Yes

  • No


Results are only viewable after voting.

JuliaZ

Newbie
Jul 17, 2019
12
0
Hello everyone!
I know, that among you there are great app developers. So, I would like to create simple Android app (version 6+) to detect plant diseases. It would be capable to use both photoes and saved images in phone memory. Model now is saving in .tflite (.lite) format. It was pre-trained on 30 classes. All neccessary model files would be done.

If it is interesting for you, please inform me! :)
 
Also I try to intergrate my model there:
https://github.com/googlecodelabs/tensorflow-for-poets-2/tree/master/android/tflite
In file ImageClassifier.java I have changed this parameters:
Code:
static final int DIM_IMG_SIZE_X = 256;
static final int DIM_IMG_SIZE_Y = 256;
By the way there is a problem with Interpreter:
"interpreter(java.nio.mappedbytebuffer)' is deprecated"
Code:
ImageClassifier(Activity activity) throws IOException {
  tflite = new Interpreter(loadModelFile(activity));
  labelList = loadLabelList(activity);
  imgData =
      ByteBuffer.allocateDirect(
          4 * DIM_BATCH_SIZE * DIM_IMG_SIZE_X * DIM_IMG_SIZE_Y * DIM_PIXEL_SIZE);
  imgData.order(ByteOrder.nativeOrder());
  labelProbArray = new float[1][labelList.size()];
  filterLabelProbArray = new float[FILTER_STAGES][labelList.size()];
  Log.d(TAG, "Created a Tensorflow Lite Image Classifier.");
}

I am getting a mistake in app: "uninitialized classifier or invalid context".
What parameters do I need to change too?
 

Attachments

  • OEKmKVRrh5E.jpg
    OEKmKVRrh5E.jpg
    75 KB · Views: 90
Last edited:
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones