Spaces:
Running
Running
| import os | |
| os.system('pip install gradio==5.33.2') | |
| import gradio as gr | |
| import random | |
| _TITLE = ''' | |
| # Diffusion Knows Transparency: Repurposing Video Diffusion for Transparent Object Depth and Normal Estimation | |
| ''' | |
| html = ''' | |
| <!DOCTYPE html> | |
| <html> | |
| <body> | |
| <iframe id="myIframe" width="100%" height="1500" frameborder="0"></iframe> | |
| </body> | |
| </html> | |
| ''' | |
| script = ''' | |
| function createGradio() { | |
| const urls = [ | |
| "https://f49c696015564e6d64.gradio.live/" | |
| ]; | |
| const randomIndex = Math.floor(Math.random() * urls.length); | |
| document.getElementById("myIframe").src = urls[randomIndex]; | |
| // 隐藏外层 Gradio 的 footer | |
| const style = document.createElement('style'); | |
| style.textContent = ` | |
| footer { display: none !important; } | |
| .gradio-container footer { display: none !important; } | |
| #footer { display: none !important; } | |
| `; | |
| document.head.appendChild(style); | |
| // 延迟执行,确保 DOM 加载完成 | |
| setTimeout(() => { | |
| const footers = document.querySelectorAll('footer, .gradio-container footer, #footer'); | |
| footers.forEach(footer => footer.style.display = 'none'); | |
| }, 100); | |
| } | |
| ''' | |
| def dkt_app(): | |
| # CSS 来隐藏 footer | |
| css = """ | |
| footer { display: none !important; } | |
| .gradio-container footer { display: none !important; } | |
| #footer { display: none !important; } | |
| """ | |
| with gr.Blocks(css=css, js=script) as demo: | |
| gr.Markdown(_TITLE) | |
| gr.HTML(html) | |
| demo.launch() | |
| if __name__ == "__main__": | |
| dkt_app() | |