Spaces:
Running
Running
File size: 1,580 Bytes
c4d330b 23bc142 c4d330b 2dc4ed1 19cf8fd f797981 19cf8fd f797981 b56b6e8 f797981 19cf8fd b56b6e8 f797981 212c769 2682584 f797981 2dc4ed1 f797981 b56b6e8 f797981 2dc4ed1 f797981 b56b6e8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
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()
|