CesarLeblanc commited on
Commit
2c6ecb2
·
verified ·
1 Parent(s): 20d36fe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -56,12 +56,13 @@ def classification(text, k):
56
  else:
57
  text = f"This vegetation plot probably belongs to the habitat type {', '.join(habitat_labels[:-1])}, or {habitat_labels[-1]}."
58
  text += f"\nThe most likely habitat type (i.e., {habitat_labels[0]}) is named '{habitat_name}'."
59
- image_output = return_image("classification", habitat_labels[0])
60
- if image_output is not None:
61
  text += "\nBelow is an example of this habitat type taken from the website FloraVEG."
62
  else:
63
  text += f"\nNo image found for this habitat type."
64
- return text, image_output
 
65
 
66
  def masking(text, k):
67
  text = gbif_normalization(text)
@@ -118,7 +119,7 @@ def masking(text, k):
118
  text += f"\nBelow is an image of the first missing species (i.e., {best_predictions[0].capitalize()}) taken from the website FloraVEG."
119
  else:
120
  text += f"\nNo image found for the first missing species (i.e., {best_predictions[0].capitalize()})."
121
-
122
  return text, image
123
 
124
  with gr.Blocks() as demo:
 
56
  else:
57
  text = f"This vegetation plot probably belongs to the habitat type {', '.join(habitat_labels[:-1])}, or {habitat_labels[-1]}."
58
  text += f"\nThe most likely habitat type (i.e., {habitat_labels[0]}) is named '{habitat_name}'."
59
+ image = return_image("classification", habitat_labels[0])
60
+ if image is not None:
61
  text += "\nBelow is an example of this habitat type taken from the website FloraVEG."
62
  else:
63
  text += f"\nNo image found for this habitat type."
64
+ image = gr.Image("https://img.freepik.com/premium-vector/file-folder-mascot-character-design-vector_166742-4413.jpg")
65
+ return text, image
66
 
67
  def masking(text, k):
68
  text = gbif_normalization(text)
 
119
  text += f"\nBelow is an image of the first missing species (i.e., {best_predictions[0].capitalize()}) taken from the website FloraVEG."
120
  else:
121
  text += f"\nNo image found for the first missing species (i.e., {best_predictions[0].capitalize()})."
122
+ image = gr.Image("https://img.freepik.com/premium-vector/file-folder-mascot-character-design-vector_166742-4413.jpg")
123
  return text, image
124
 
125
  with gr.Blocks() as demo: