pd home uncommented and updated Diseases class

parent 6ba3ebb8
......@@ -25,7 +25,8 @@ import java.nio.ByteOrder;
import org.tensorflow.lite.DataType;
import org.tensorflow.lite.support.tensorbuffer.TensorBuffer;
import com.example.eketha.ml.Model;
import com.example.eketha.ml.Dmodel;
public class Diseases extends AppCompatActivity {
......@@ -93,7 +94,8 @@ public class Diseases extends AppCompatActivity {
inputFeature0.loadBuffer(byteBuffer);
// Runs model inference and gets result.
Model.Outputs outputs = model.process(inputFeature0);
Dmodel dModel = Dmodel.newInstance(getApplicationContext());
Dmodel.Outputs outputs = dModel.process(inputFeature0);
TensorBuffer outputFeature0 = outputs.getOutputFeature0AsTensorBuffer();
float[] confidences = outputFeature0.getFloatArray();
......@@ -124,7 +126,7 @@ public class Diseases extends AppCompatActivity {
// Releases model resources if no longer used.
model.close();
dModel.close();
} catch (IOException e) {
// TODO Handle the exception
}
......
......@@ -19,20 +19,20 @@ public class pdHome extends AppCompatActivity {
layer1 = findViewById(R.id.layerPestsDP);
layer2 = findViewById(R.id.layerDiseasesPD);
// layer1.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// Intent intent = new Intent(getApplicationContext(), Diseases.class);
// startActivity(intent);
// }
// });
// layer2.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// Intent intent = new Intent(getApplicationContext(), Pests.class);
// startActivity(intent);
// }
// });
layer1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(getApplicationContext(), Diseases.class);
startActivity(intent);
}
});
layer2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(getApplicationContext(), Pests.class);
startActivity(intent);
}
});
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment