1. Are you ready for the Galaxy S20? Here is everything we know so far!

Plants Detection

Discussion in 'Android Development' started by JuliaZ, Jul 17, 2019.

?

It is interesting for you?

  1. Yes

  2. No

Multiple votes are allowed.
Results are only viewable after voting.
  1. JuliaZ

    JuliaZ Newbie
    Thread Starter

    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! :)
     


  2. Deleted User

    Deleted User Guest

    I'm assuming you're asking for someone to implement this app for you?

    If you want help in developing it yourself, it would be helpful if you could ask some more specific questions.
     
    #2 Deleted User, Jul 17, 2019
    Last edited by a moderator: Jul 17, 2019
  3. JuliaZ

    JuliaZ Newbie
    Thread Starter

    Now I am trying to integrate my model to simple preparied Android app...
     
  4. Deleted User

    Deleted User Guest

    If you get stuck on a specific problem, please include any relevant code. Use [code] [/code] tags to format it.

    Thanks.
     
  5. JuliaZ

    JuliaZ Newbie
    Thread Starter

  6. Deleted User

    Deleted User Guest

  7. JuliaZ

    JuliaZ Newbie
    Thread Starter

    My model was trained on 30 classes, input image has a dimension of 256/256 pixels.
    If it is neccessary to know other model parameters, I will write them...
    There are model output labels in attached file.
     

    Attached Files:

    #8 JuliaZ, Jul 18, 2019
    Last edited: Jul 18, 2019
  8. JuliaZ

    JuliaZ Newbie
    Thread Starter

    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 (Text):
    1.  
    2. static final int DIM_IMG_SIZE_X = 256;
    3. static final int DIM_IMG_SIZE_Y = 256;
    4.  
    By the way there is a problem with Interpreter:
    "interpreter(java.nio.mappedbytebuffer)' is deprecated"
    Code (Text):
    1.  
    2. ImageClassifier(Activity activity) throws IOException {
    3.   tflite = new Interpreter(loadModelFile(activity));
    4.   labelList = loadLabelList(activity);
    5.   imgData =
    6.       ByteBuffer.allocateDirect(
    7.           4 * DIM_BATCH_SIZE * DIM_IMG_SIZE_X * DIM_IMG_SIZE_Y * DIM_PIXEL_SIZE);
    8.   imgData.order(ByteOrder.nativeOrder());
    9.   labelProbArray = new float[1][labelList.size()];
    10.   filterLabelProbArray = new float[FILTER_STAGES][labelList.size()];
    11.   Log.d(TAG, "Created a Tensorflow Lite Image Classifier.");
    12. }
    13.  
    I am getting a mistake in app: "uninitialized classifier or invalid context".
    What parameters do I need to change too?
     

    Attached Files:

    #9 JuliaZ, Jul 18, 2019
    Last edited: Jul 18, 2019
Loading...

Share This Page

Loading...