Spaces:
Runtime error
Runtime error
import gradio as gr | |
import os | |
''' | |
def inference(image, task): | |
if not os.path.exists('tmp'): | |
os.system('mkdir tmp') | |
image.save("tmp/lq_image.png", "PNG") | |
if task == 'X-ray_Image_Denoising': | |
os.system("python Denoise_XRay.py --test_path ./tmp/lq_image.png --save_path ./tmp/ --checkpoint checkpoints/ESTNet.pth") | |
if task == 'LowLight_Image_Enhancement': | |
os.system("python LowLight.py --test_path ./tmp/lq_image.png --save_path ./tmp/ --checkpoint checkpoints/LowLight_model.pth") | |
if task == 'Real_world_image_Denoising': | |
os.system("python Denoise_SIDD.py --test_path ./tmp/lq_image.png --save_path ./tmp/ --checkpoint checkpoints/SIDD.pth") | |
if task == 'Underwater_Image_Enhancement': | |
os.system( | |
"python Underwater.py --test_path ./tmp/lq_image.png --save_path ./tmp/ --checkpoint checkpoints/Underwater.pth") | |
return 'tmp/output.png' | |
title = "基于物理模型与深度学习的复杂环境图像复原方法" | |
description = "本项目旨在开发一种综合利用物理传播模型与深度学习技术的智能图像复原方法,以应对复杂环境下的图像退化问题。我们将研究针对低照度、水下、相机拍摄图像等复杂成像场景,结合物理传播行为,设计高效的图像复原和增强算法。通过数据采集、模型训练和算法优化,实现在实际环境中的应用,拓展到多个领域,如遥感、医学成像等" | |
article = "" | |
examples = [['demo/01.JPG', 'LowLight_Image_Enhancement'], | |
['demo/noise.png', 'X-ray_Image_Denoising'], | |
['demo/SIDD.png', 'Real_world_image_Denoising'], | |
['demo/Underwater.png', 'Underwater_Image_Enhancement']] | |
iface = gr.Interface( | |
inference, | |
[gr.inputs.Image(type="pil", label="Input"), | |
gr.inputs.Radio(["LowLight_Image_Enhancement", "X-ray_Image_Denoising", "Real_world_image_Denoising", "Underwater_Image_Enhancement"], default="Real_world_image_Denoising", label='task'),], | |
gr.outputs.Image(type="numpy", label="Output"), | |
title=title, | |
description=description, | |
article=article, | |
enable_queue=True, | |
examples=examples | |
) | |
iface.launch(debug=True, enable_queue=True) | |
''' | |
# iface.launch(debug=False, enable_queue=True) |