stupidog04 commited on
Commit
b5823a9
·
1 Parent(s): 3ab4391

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -195,16 +195,16 @@ def inference(video, lang, full_scan, number_filter, use_trocr, time_step, perio
195
  df_list.append({"Box": f"", "Time (s)": "", "Text": ""})
196
  df = pd.concat([pd.DataFrame(df_list)])
197
 
198
- # Convert the Matplotlib plot to a NumPy array
199
- plot_fig = plot_temporal_profile(temporal_profiles)
200
- buf = io.BytesIO()
201
- plot_fig.savefig(buf, format='png')
202
- buf.seek(0)
203
- # Convert the resized image to a NumPy array
204
- plot_np = np.array(PIL.Image.open(buf))
205
 
206
- # Close the buffer
207
- buf.close()
208
 
209
  # return output, im, plot_np, df # Change this line
210
  return output, im, im, df # Change this line
@@ -245,9 +245,9 @@ gr.Interface(
245
  ],
246
  [
247
  gr.outputs.Video(label='Output Video'),
248
- gr.outputs.Image(label='Output Preview', type='numpy').style(height=480),
249
  # gr.Plot(label='Temporal Profile'),
250
- gr.outputs.Image(label='Temporal Profile', type='numpy').style(height=640),
251
  gr.outputs.Dataframe(headers=['Box', 'Time (s)', 'Text'], type='pandas')
252
  ],
253
  title=title,
 
195
  df_list.append({"Box": f"", "Time (s)": "", "Text": ""})
196
  df = pd.concat([pd.DataFrame(df_list)])
197
 
198
+ # # Convert the Matplotlib plot to a NumPy array
199
+ # plot_fig = plot_temporal_profile(temporal_profiles)
200
+ # buf = io.BytesIO()
201
+ # plot_fig.savefig(buf, format='png')
202
+ # buf.seek(0)
203
+ # # Convert the resized image to a NumPy array
204
+ # plot_np = np.array(PIL.Image.open(buf))
205
 
206
+ # # Close the buffer
207
+ # buf.close()
208
 
209
  # return output, im, plot_np, df # Change this line
210
  return output, im, im, df # Change this line
 
245
  ],
246
  [
247
  gr.outputs.Video(label='Output Video'),
248
+ gr.outputs.Image(label='Output Preview', type='numpy')#.style(height=480),
249
  # gr.Plot(label='Temporal Profile'),
250
+ gr.outputs.Image(label='Temporal Profile', type='numpy')#.style(height=640),
251
  gr.outputs.Dataframe(headers=['Box', 'Time (s)', 'Text'], type='pandas')
252
  ],
253
  title=title,