iamrobotbear commited on
Commit
4385c07
·
1 Parent(s): 44eb5f9

trying to change to not output to html first, then straight to df

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -116,14 +116,12 @@ def process_images_and_statements(image):
116
 
117
  logging.info('Finished process_images_and_statements')
118
 
119
- # Convert DataFrame to a formatted string and return it
120
- output = results_df.to_html(index=False)
121
-
122
- return output
123
 
124
  # Gradio interface
125
  image_input = gr.inputs.Image()
126
- output = gr.outputs.Dataframe(type="pandas", label="Results")
127
 
128
  iface = gr.Interface(fn=process_images_and_statements, inputs=image_input, outputs=output, title="Image Captioning and Image-Text Matching")
129
  iface.launch()
 
116
 
117
  logging.info('Finished process_images_and_statements')
118
 
119
+ # Return the DataFrame directly as output (no need to convert to HTML)
120
+ return results_df # <--- Return results_df directly
 
 
121
 
122
  # Gradio interface
123
  image_input = gr.inputs.Image()
124
+ output = gr.outputs.Dataframe(type="pandas", label="Results") # <--- Use "pandas" type for DataFrame output
125
 
126
  iface = gr.Interface(fn=process_images_and_statements, inputs=image_input, outputs=output, title="Image Captioning and Image-Text Matching")
127
  iface.launch()