TibbtechUser commited on
Commit
202ae2b
·
verified ·
1 Parent(s): 255da82

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -78,6 +78,8 @@ def plot_probabilities(probabilities):
78
  return None
79
  prob_df = pd.DataFrame({"labels": cell_types, "values": probabilities})
80
  prob_df.to_csv('Cell_types_predictions.csv', index=False)
 
 
81
  return prob_df
82
 
83
  def run_mapping():
@@ -116,7 +118,7 @@ with gr.Blocks() as demo:
116
  gr.Markdown("### Step 5: Quantitative results of the mapping model.")
117
  prob_plot = gr.BarPlot(prob_df, x="labels", y="values", title="Cell Type Probabilities", scroll_to_output=True, x_label_angle=-90, height = 400)
118
  gr.Markdown("### Step 6: Download Results.")
119
- download_button = gr.DownloadButton(label="Download Results", value='./Cell_types_predictions.csv')
120
 
121
  nifti_file.change(load_nifti, inputs=nifti_file, outputs=[image_display, slice_slider, gallery, slice_row, plot_row])
122
  slice_slider.change(update_slice, inputs=slice_slider, outputs=[image_display, prob_plot, gallery])
 
78
  return None
79
  prob_df = pd.DataFrame({"labels": cell_types, "values": probabilities})
80
  prob_df.to_csv('Cell_types_predictions.csv', index=False)
81
+ print("CSV saved!!")
82
+
83
  return prob_df
84
 
85
  def run_mapping():
 
118
  gr.Markdown("### Step 5: Quantitative results of the mapping model.")
119
  prob_plot = gr.BarPlot(prob_df, x="labels", y="values", title="Cell Type Probabilities", scroll_to_output=True, x_label_angle=-90, height = 400)
120
  gr.Markdown("### Step 6: Download Results.")
121
+ download_button = gr.DownloadButton(label="Download Results", value='Cell_types_predictions.csv')
122
 
123
  nifti_file.change(load_nifti, inputs=nifti_file, outputs=[image_display, slice_slider, gallery, slice_row, plot_row])
124
  slice_slider.change(update_slice, inputs=slice_slider, outputs=[image_display, prob_plot, gallery])