Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
com-ent-projet38-2024
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PFEFFER Melvil
com-ent-projet38-2024
Commits
5ac83c4d
Commit
5ac83c4d
authored
7 months ago
by
“kamon
Browse files
Options
Downloads
Patches
Plain Diff
implémentation détection d'espèces avec cadres mais sans exceptions
parent
279233a8
No related branches found
No related tags found
1 merge request
!2
merge all branches, model integration
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/src/main/java/com/example/myapplication/PhotoPage.java
+10
-1
10 additions, 1 deletion
app/src/main/java/com/example/myapplication/PhotoPage.java
app/src/main/res/layout/fragment_photo_page.xml
+6
-6
6 additions, 6 deletions
app/src/main/res/layout/fragment_photo_page.xml
with
16 additions
and
7 deletions
app/src/main/java/com/example/myapplication/PhotoPage.java
+
10
−
1
View file @
5ac83c4d
...
@@ -122,6 +122,8 @@ public class PhotoPage extends Fragment {
...
@@ -122,6 +122,8 @@ public class PhotoPage extends Fragment {
try
{
try
{
TestModeleTflite
testModeleTflite
=
new
TestModeleTflite
(
this
.
getContext
());
TestModeleTflite
testModeleTflite
=
new
TestModeleTflite
(
this
.
getContext
());
/*
List<String> speciesDetected = testModeleTflite.recognizeSpeciesClass(scaledBitmap);
List<String> speciesDetected = testModeleTflite.recognizeSpeciesClass(scaledBitmap);
StringBuilder recognationOutput = new StringBuilder("Espèces détectées : ");
StringBuilder recognationOutput = new StringBuilder("Espèces détectées : ");
...
@@ -130,7 +132,14 @@ public class PhotoPage extends Fragment {
...
@@ -130,7 +132,14 @@ public class PhotoPage extends Fragment {
}
}
TextView textView = getView().findViewById(R.id.textView2);
TextView textView = getView().findViewById(R.id.textView2);
textView
.
setText
(
recognationOutput
);
textView.setText(recognationOutput);*/
Bitmap
annotatedImage
=
testModeleTflite
.
recognizeSpecies
(
bitmap
);
double
height
=
1.5
*
annotatedImage
.
getHeight
();
double
width
=
1.5
*
annotatedImage
.
getWidth
();
scaledBitmap
=
Bitmap
.
createScaledBitmap
(
annotatedImage
,
(
int
)
width
,
(
int
)
height
,
true
);
imageView
.
setImageBitmap
(
scaledBitmap
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
}
...
...
This diff is collapsed.
Click to expand it.
app/src/main/res/layout/fragment_photo_page.xml
+
6
−
6
View file @
5ac83c4d
...
@@ -54,22 +54,22 @@
...
@@ -54,22 +54,22 @@
<!-- Folder Button -->
<!-- Folder Button -->
<Button
<Button
android:id=
"@+id/folder_button"
android:id=
"@+id/folder_button"
style=
"@style/ButtonAppearance"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"16dp"
android:layout_marginStart=
"16dp"
android:layout_marginBottom=
"340dp"
android:layout_marginBottom=
"340dp"
android:text=
"Folder"
android:backgroundTint=
"#517293"
android:text=
"gallerie"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@+id/camera_button"
app:layout_constraintStart_toEndOf=
"@+id/camera_button"
/>
android:backgroundTint=
"#517293"
style=
"@style/ButtonAppearance"
/>
<!-- Main Image Display -->
<!-- Main Image Display -->
<ImageView
<ImageView
android:id=
"@+id/imageView"
android:id=
"@+id/imageView"
android:layout_width=
"
285
dp"
android:layout_width=
"
314
dp"
android:layout_height=
"2
41
dp"
android:layout_height=
"2
88
dp"
app:layout_constraintBottom_toTopOf=
"@+id/textView"
app:layout_constraintBottom_toTopOf=
"@+id/textView"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.507"
app:layout_constraintHorizontal_bias=
"0.507"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment