Skip to content
Snippets Groups Projects
Commit 5ac83c4d authored by “kamon's avatar “kamon
Browse files

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!2merge all branches, model integration
...@@ -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);
} }
......
...@@ -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="285dp" android:layout_width="314dp"
android:layout_height="241dp" android:layout_height="288dp"
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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment