davidyang5 commited on
Commit
96259a0
·
verified ·
1 Parent(s): ae827d9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -102,9 +102,19 @@ def get_example_images():
102
 
103
  def create_interface():
104
  with gr.Blocks(title="Image Captioning") as demo:
105
- gr.Markdown("# Image Captioning Demo")
106
- gr.Markdown("Upload an image to generate a caption using our transformer-based model.")
107
 
 
 
 
 
 
 
 
 
 
 
108
  with gr.Row():
109
  with gr.Column():
110
  # Input image
@@ -129,16 +139,6 @@ def create_interface():
129
  outputs=caption_output
130
  )
131
 
132
- # Example images using all images from img directory
133
- example_images = get_example_images()
134
- if example_images:
135
- gr.Examples(
136
- examples=example_images,
137
- inputs=image_input,
138
- label="Example Images"
139
- )
140
- else:
141
- gr.Markdown("No example images found in the img directory.")
142
 
143
  return demo
144
 
 
102
 
103
  def create_interface():
104
  with gr.Blocks(title="Image Captioning") as demo:
105
+ gr.Markdown("# Image Captioning Model")
106
+ gr.Markdown("Use one of the example images or upload your own")
107
 
108
+ # Example images using all images from img directory
109
+ example_images = get_example_images()
110
+ if example_images:
111
+ gr.Examples(
112
+ examples=example_images,
113
+ inputs=image_input,
114
+ label="Example Images"
115
+ )
116
+ else:
117
+ gr.Markdown("No example images found in the img directory.")
118
  with gr.Row():
119
  with gr.Column():
120
  # Input image
 
139
  outputs=caption_output
140
  )
141
 
 
 
 
 
 
 
 
 
 
 
142
 
143
  return demo
144