| import os |
| import gradio as gr |
| from PIL import Image |
|
|
|
|
| os.system( |
| 'wget https://github.com/FanChiMao/SRMNet/releases/download/0.0/real_denoising_SRMNet.pth -P experiments/pretrained_models') |
|
|
|
|
| def inference(img): |
| os.system('mkdir test') |
| |
| |
| |
| |
| img.save("test/1.png", "PNG") |
| os.system( |
| 'python main_test_SRMNet.py --input_dir test --weights experiments/pretrained_models/real_denoising_SRMNet.pth') |
| return 'result/1.png' |
|
|
|
|
| title = "<span style='color: #191970;'>Aiconvert.online</span>" |
| description = "" |
| article = "" |
|
|
| examples = [['Noise.png'], ['Noise2.png']] |
| gr.Interface( |
| inference, |
| [gr.inputs.Image(type="pil", label="Input")], |
| gr.outputs.Image(type="filepath", label="Output"), |
| title=title, |
| description=description, |
| article=article, |
| css=".gradio-container {background-color: #FFE4C4} footer{display:none !important;}", |
| allow_flagging=False, |
| allow_screenshot=False, |
| examples=examples |
| ).launch(debug=True) |