wangli commited on
Update gradio demo
Browse filesFiles changed (5)
79 unmodified lines808182838483848586878889869091929379 unmodified lines[INFO] SOC Name: AX650N[INFO] VNPU type: VNPUType.DISABLED[INFO] Compiler version: 4.2-dirty 5e72cf06-dirty* Running on local URL: http://0.0.0.0:7860* To create a public link, set `share=True` in `launch()`.
==================================================🌐 人脸修复工具 Web UI 已启动!🔗 本地访问: http://127.0.0.1:7860🔗 局域网访问: http://10.126.33.124:7860==================================================```Then use the M.2 Accelerator card IP instead of the 0.0.0.0, and use chrome open the URL: http://[your ip]:7860Then open the link in the terminal to access the web UI.
4 unmodified lines567891011188 unmodified lines2002012022032042052062072082092102112122132142152162032172182192202212222232242252262272282292302312322332342352362372382394 unmodified linesimport axengine as axeimport cv2from utils.restoration_helper import RestoreHelperimport socket
restore_helper = RestoreHelper( upscale_factor=1,188 unmodified lines )
# 启动def get_local_ip(): """获取本机局域网IP地址""" try: # 创建一个UDP连接(不会真正发送数据) with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as s: s.connect(("8.8.8.8", 80)) # 连接到公共DNS(Google) ip = s.getsockname()[0] return ip except Exception: # 回退到 localhost return "127.0.0.1"
if __name__ == "__main__": demo.launch(server_name="0.0.0.0", server_port=7860, theme=gr.themes.Soft(), css=custom_css) # demo.launch(server_name="0.0.0.0", server_port=7860, theme=gr.themes.Soft())
server_port = 7860 server_name = "0.0.0.0" # 获取本机IP local_ip = get_local_ip() # 打印可点击的URL(大多数终端支持点击) print("\n" + "="*50) print("🌐 人脸修复工具 Web UI 已启动!") print(f"🔗 本地访问: http://127.0.0.1:{server_port}") if local_ip != "127.0.0.1": print(f"🔗 局域网访问: http://{local_ip}:{server_port}") print("="*50 + "\n")
# 启动Gradio应用 demo.launch( server_name=server_name, server_port=server_port, theme=gr.themes.Soft(), css=custom_css )README.md+7-3
python/gradio_demo.py+37-1
python/utils/__pycache__/face_detector.cpython-313.pyc
python/utils/__pycache__/general.cpython-313.pyc
python/utils/__pycache__/restoration_helper.cpython-313.pyc