Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2022-81
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2022-81
2022-81
Commits
cb0c1c70
Commit
cb0c1c70
authored
Nov 12, 2022
by
Salika Madhushanka W.J
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'IT19101620_2' into 'master'
pd home uncommented and updated Diseases class See merge request
!9
parents
a3a9304b
6c45342b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
18 deletions
+20
-18
app/src/main/java/com/example/eketha/Diseases.java
app/src/main/java/com/example/eketha/Diseases.java
+5
-3
app/src/main/java/com/example/eketha/pdHome.java
app/src/main/java/com/example/eketha/pdHome.java
+15
-15
No files found.
app/src/main/java/com/example/eketha/Diseases.java
View file @
cb0c1c70
...
@@ -25,7 +25,8 @@ import java.nio.ByteOrder;
...
@@ -25,7 +25,8 @@ import java.nio.ByteOrder;
import
org.tensorflow.lite.DataType
;
import
org.tensorflow.lite.DataType
;
import
org.tensorflow.lite.support.tensorbuffer.TensorBuffer
;
import
org.tensorflow.lite.support.tensorbuffer.TensorBuffer
;
import
com.example.eketha.ml.Model
;
import
com.example.eketha.ml.Dmodel
;
public
class
Diseases
extends
AppCompatActivity
{
public
class
Diseases
extends
AppCompatActivity
{
...
@@ -93,7 +94,8 @@ public class Diseases extends AppCompatActivity {
...
@@ -93,7 +94,8 @@ public class Diseases extends AppCompatActivity {
inputFeature0
.
loadBuffer
(
byteBuffer
);
inputFeature0
.
loadBuffer
(
byteBuffer
);
// Runs model inference and gets result.
// 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
();
TensorBuffer
outputFeature0
=
outputs
.
getOutputFeature0AsTensorBuffer
();
float
[]
confidences
=
outputFeature0
.
getFloatArray
();
float
[]
confidences
=
outputFeature0
.
getFloatArray
();
...
@@ -124,7 +126,7 @@ public class Diseases extends AppCompatActivity {
...
@@ -124,7 +126,7 @@ public class Diseases extends AppCompatActivity {
// Releases model resources if no longer used.
// Releases model resources if no longer used.
m
odel
.
close
();
dM
odel
.
close
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
// TODO Handle the exception
// TODO Handle the exception
}
}
...
...
app/src/main/java/com/example/eketha/pdHome.java
View file @
cb0c1c70
...
@@ -19,20 +19,20 @@ public class pdHome extends AppCompatActivity {
...
@@ -19,20 +19,20 @@ public class pdHome extends AppCompatActivity {
layer1
=
findViewById
(
R
.
id
.
layerPestsDP
);
layer1
=
findViewById
(
R
.
id
.
layerPestsDP
);
layer2
=
findViewById
(
R
.
id
.
layerDiseasesPD
);
layer2
=
findViewById
(
R
.
id
.
layerDiseasesPD
);
//
layer1.setOnClickListener(new View.OnClickListener() {
layer1
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
//
@Override
@Override
//
public void onClick(View view) {
public
void
onClick
(
View
view
)
{
//
Intent intent = new Intent(getApplicationContext(), Diseases.class);
Intent
intent
=
new
Intent
(
getApplicationContext
(),
Diseases
.
class
);
//
startActivity(intent);
startActivity
(
intent
);
//
}
}
//
});
});
//
layer2.setOnClickListener(new View.OnClickListener() {
layer2
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
//
@Override
@Override
//
public void onClick(View view) {
public
void
onClick
(
View
view
)
{
//
Intent intent = new Intent(getApplicationContext(), Pests.class);
Intent
intent
=
new
Intent
(
getApplicationContext
(),
Pests
.
class
);
//
startActivity(intent);
startActivity
(
intent
);
//
}
}
//
});
});
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment