Spaces:
Runtime error
Runtime error
updated app.py
Browse files431 unmodified lines43243343443543643743817 unmodified lines45645745845946046146225 unmodified lines4884894904914924934943 unmodified lines498499500501502503504431 unmodified linesif len(probabilities) < 1:return Noneprob_df = pd.DataFrame({"labels": cell_types, "values": probabilities})prob_df.to_csv('Cell_types_predictions.csv', index=False)return prob_dfdef run_mapping():17 unmodified linesreturn "Registration complete!"def download_csv():return 'Cell_types_predictions.csv'def handle_data_type_change(dt):25 unmodified linesslice_slider = gr.Slider(minimum=0, maximum=0, value=0, step=1, label="Slices", visible=False)with gr.Column(scale=1):gr.Markdown("### Step 3: Visualizing Allen Brain Cell Types Atlas")gallery = gr.Gallery(label="ABC Atlas", value = gallery_images,)gr.Markdown("**Step 4: Run cell type mapping**")with gr.Row():run_button = gr.Button("Run Mapping")3 unmodified linesgr.Markdown("### Step 5: Quantitative results of the mapping model.")prob_plot = gr.BarPlot(prob_df, x="labels", y="values", title="Cell Type Probabilities", scroll_to_output=True, x_label_angle=-90, height=400)gr.Markdown("### Step 6: Download Results.")download_button = gr.DownloadButton(label="Download Results", value='Cell_types_predictions.csv')nifti_file.change(load_nifti_or_png,431 unmodified lines43243343443543643743817 unmodified lines45645745845946046146225 unmodified lines4884894904914924934943 unmodified lines498499500501502503504431 unmodified linesif len(probabilities) < 1:return Noneprob_df = pd.DataFrame({"labels": cell_types, "values": probabilities})prob_df.to_csv('./Cell_types_predictions.csv', index=False)return prob_dfdef run_mapping():17 unmodified linesreturn "Registration complete!"def download_csv():return './Cell_types_predictions.csv'def handle_data_type_change(dt):25 unmodified linesslice_slider = gr.Slider(minimum=0, maximum=0, value=0, step=1, label="Slices", visible=False)with gr.Column(scale=1):gr.Markdown("### Step 3: Visualizing Allen Brain Cell Types Atlas")gallery = gr.Gallery(label="ABC Atlas", value = gallery_images,columns = 5, height = 450)gr.Markdown("**Step 4: Run cell type mapping**")with gr.Row():run_button = gr.Button("Run Mapping")3 unmodified linesgr.Markdown("### Step 5: Quantitative results of the mapping model.")prob_plot = gr.BarPlot(prob_df, x="labels", y="values", title="Cell Type Probabilities", scroll_to_output=True, x_label_angle=-90, height=400)gr.Markdown("### Step 6: Download Results.")download_button = gr.DownloadButton(label="Download Results", value='./Cell_types_predictions.csv')nifti_file.change(load_nifti_or_png,
app.py+4-4