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
6c45342b
Commit
6c45342b
authored
Nov 12, 2022
by
Salika Madhushanka W.J
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pd home uncommented and updated Diseases class
parent
6ba3ebb8
Changes
2
Hide 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 @
6c45342b
...
...
@@ -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.
m
odel
.
close
();
dM
odel
.
close
();
}
catch
(
IOException
e
)
{
// TODO Handle the exception
}
...
...
app/src/main/java/com/example/eketha/pdHome.java
View file @
6c45342b
...
...
@@ -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
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