Skip to content
Snippets Groups Projects
Commit 825dccda authored by SOURABIE Kamon's avatar SOURABIE Kamon
Browse files

Merge branch 'integration_modele_via_tflite' into 'main'

Affichage de prediction multiple

See merge request !11
parents 9173203a 9bd4a053
No related branches found
No related tags found
1 merge request!11Affichage de prediction multiple
...@@ -37,7 +37,7 @@ public class PhotoPage extends Fragment { ...@@ -37,7 +37,7 @@ public class PhotoPage extends Fragment {
private static String predictionOutput; private static String predictionOutput;
Button cameraButton, folderButton; Button cameraButton, folderButton, identifiedSpeciesButton;
TextView textPredictionOutput, textProbabilityOutput; TextView textPredictionOutput, textProbabilityOutput;
ImageView imageView; ImageView imageView;
FrameLayout formLayout; FrameLayout formLayout;
...@@ -48,12 +48,14 @@ public class PhotoPage extends Fragment { ...@@ -48,12 +48,14 @@ public class PhotoPage extends Fragment {
@Nullable @Nullable
@Override @Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
predictionOutput = null;
View view = inflater.inflate(R.layout.fragment_photo_page, container, false); View view = inflater.inflate(R.layout.fragment_photo_page, container, false);
// Initialize UI elements // Initialize UI elements
cameraButton = view.findViewById(R.id.camera_button); cameraButton = view.findViewById(R.id.camera_button);
folderButton = view.findViewById(R.id.folder_button); folderButton = view.findViewById(R.id.folder_button);
identifiedSpeciesButton = view.findViewById(R.id.identified_species_button);
textPredictionOutput = view.findViewById(R.id.textPredictionOutput); textPredictionOutput = view.findViewById(R.id.textPredictionOutput);
textProbabilityOutput = view.findViewById(R.id.textProbabilityOutput); //textProbabilityOutput = view.findViewById(R.id.textProbabilityOutput);
imageView = view.findViewById(R.id.main_image_display); imageView = view.findViewById(R.id.main_image_display);
Button seeTutoButton = view.findViewById(R.id.see_tuto); Button seeTutoButton = view.findViewById(R.id.see_tuto);
...@@ -82,6 +84,17 @@ public class PhotoPage extends Fragment { ...@@ -82,6 +84,17 @@ public class PhotoPage extends Fragment {
} }
}); });
identifiedSpeciesButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(predictionOutput == null){
Toast.makeText(getContext(), "Veuillez prendre une photo ou charger une image depuis votre gallerie.", Toast.LENGTH_LONG).show();
}
else Toast.makeText(getContext(), predictionOutput, Toast.LENGTH_LONG).show();
}
});
View.OnClickListener lSeeTutoButton = new View.OnClickListener() { View.OnClickListener lSeeTutoButton = new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
...@@ -90,6 +103,8 @@ public class PhotoPage extends Fragment { ...@@ -90,6 +103,8 @@ public class PhotoPage extends Fragment {
startActivity(intent); startActivity(intent);
getActivity().finish(); getActivity().finish();
} }
}; };
seeTutoButton.setOnClickListener(lSeeTutoButton); seeTutoButton.setOnClickListener(lSeeTutoButton);
......
...@@ -65,6 +65,7 @@ ...@@ -65,6 +65,7 @@
tools:srcCompat="@tools:sample/avatars" /> tools:srcCompat="@tools:sample/avatars" />
<Button <Button
android:id="@+id/identified_species_button"
style="@style/ButtonAppearance" style="@style/ButtonAppearance"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -72,11 +73,17 @@ ...@@ -72,11 +73,17 @@
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:fontFamily="@font/inter" android:fontFamily="@font/inter"
android:paddingHorizontal="40dp" android:paddingHorizontal="40dp"
android:text="@string/especes" android:text="Voir espèce(s) identifiée(s)"
android:textSize="15sp" /> android:textSize="15sp" />
</FrameLayout> </FrameLayout>
<!-- Prediction Text --> <!-- Prediction Text -->
<!-- Accuracy Text -->
<!-- Prediction Label -->
<TextView <TextView
android:id="@+id/textPredictionOutput" android:id="@+id/textPredictionOutput"
android:layout_width="351dp" android:layout_width="351dp"
...@@ -88,19 +95,7 @@ ...@@ -88,19 +95,7 @@
android:textSize="17sp" android:textSize="17sp"
android:textStyle="bold" /> android:textStyle="bold" />
<!-- Accuracy Text -->
<TextView
android:id="@+id/textProbabilityOutput"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|bottom"
android:layout_marginBottom="106dp"
android:text=""
android:textColor="#F12B2B"
android:textSize="17sp"
android:textStyle="bold" />
<!-- Prediction Label -->
<TextView <TextView
android:id="@+id/prediction_label" android:id="@+id/prediction_label"
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -120,4 +115,13 @@ ...@@ -120,4 +115,13 @@
android:paddingTop="30dp" android:paddingTop="30dp"
android:paddingEnd="50dp" android:paddingEnd="50dp"
android:text="@string/photo" /> android:text="@string/photo" />
<EditText
android:id="@+id/editTextTextMultiLine4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:gravity="start|top"
android:inputType="textMultiLine" />
</FrameLayout> </FrameLayout>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment