Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| from inference import Inference | |
| import os | |
| from huggingface_hub import snapshot_download | |
| #MODEL_ID = os.getenv("MODEL_ID", "your_username/your_model_name") # 替换为你的模型ID | |
| model_path = snapshot_download(repo_id='AIMClab-RUC/UNet_DCP_1024') | |
| TEXT_OPTIONS = ["CFP", "UWF", "FFA", "SLO", "OCTA"] | |
| inference_engine = Inference(model_path=model_path) | |
| def main(image, text): | |
| out = inference_engine.inference(image, text) | |
| return out | |
| interface = gr.Interface( | |
| fn=main, | |
| inputs=[ | |
| gr.Image(type="numpy"), | |
| gr.Dropdown( | |
| choices=TEXT_OPTIONS, | |
| label="Modality", | |
| value=TEXT_OPTIONS[0] | |
| ) | |
| ], | |
| outputs=gr.Image(type="numpy"), | |
| title="Broad domain retinal vessel segmentation", | |
| description="" | |
| ) | |
| interface.launch() |