Spaces:
Sleeping
Sleeping
| from read_whole_sliding_images import * | |
| from stain_normalization import * | |
| import gradio as gr | |
| wsi2png = gr.Interface(fn=wsi2png, inputs=gr.File(), outputs=gr.Image(type='numpy'), | |
| examples=wsi2png_examples) | |
| bound_png = gr.Interface(fn=read_bounds_of_image, inputs=gr.Image(type='numpy'), | |
| outputs=gr.Image(type='numpy'), examples=read_bounds_examples) | |
| inp1 = gr.File() | |
| inp2 = gr.Slider(1, 10, 4, step=0.25, label="Resolution") | |
| # mask_wsi = gr.Interface(fn=mask_image, inputs=[inp1, inp2], outputs=gr.Image(type='numpy'), examples=mask_wsi_examples) | |
| normalize_wsi = gr.Interface(fn=normalize_stain, inputs=gr.File(), outputs=gr.Image(type='numpy'), | |
| examples=stain_normalization_wsi_examples) | |
| # demo = gr.TabbedInterface([wsi2png, bound_png, mask_wsi, normalize_wsi], ["WSI2PNG", "Bound Image", "Mask WSI", "Normalize Stain"]) | |
| demo = gr.TabbedInterface([wsi2png, bound_png, normalize_wsi], ["WSI2PNG", "Bound Image", | |
| "Normalize Stain"]) | |
| if __name__ == "__main__": | |
| demo.launch(show_api=True) |