package com.tenimaging.android.iris;

public class CaffeMobile {
    public native void setNumThreads(int numThreads);
    public native void enableLog(boolean enabled);
    public native int loadModel(String modelPath, String weightsPath);
    private native void setMeanWithMeanFile(String meanFile);
    private native void setMeanWithMeanValues(float[] meanValues);
    public native void setScale(float scale);
    public native int predictImage(long imgLong,int numResults,int[] synsetList,float[] probList);
    public native int predictImagePath(String imgPath, int numResults,int[] synsetList,float[] probList);
    //gets features for each blob name.  Blobs are from deploy.prototxt.
    //For example call caffeMobile.extractFeatures("/sdcard/DCIM/test_flowers_1.jpg","fc8,prob");
    //returns an array of outputs for fc8 and prob
    public native float[][] extractFeatures(String imgPath, String blobNames);
    public void setMean(float[] meanValues) {
        setMeanWithMeanValues(meanValues);
    }
    public void setMean(String meanFile) {
        setMeanWithMeanFile(meanFile);
    }

}

@@ -234,16 +234,54 @@
 sPath);%0A
+    public native void unloadModel();%0A
     priv
@@ -998,24 +998,16 @@
 alues) %7B
-%0A       
  setMean
@@ -1033,20 +1033,16 @@
 Values);
-%0A   
  %7D%0A    p
@@ -1082,16 +1082,8 @@
 e) %7B
-%0A       
  set
@@ -1113,14 +1113,9 @@
 le);
-%0A   
  %7D%0A
-%0A
 %7D%0A

add unloadModel() JNI