Spaces:
Sleeping
Sleeping
| # This is a simple Gradio app that embeds an iframe to display an external Hugging Face Space. | |
| import gradio as gr | |
| # Define the CSS to embed the iframe | |
| css = """ | |
| .iframe-container { | |
| position: relative; | |
| width: 100%; | |
| height: 0; | |
| padding-bottom: 100%; /* or 56.25% for 16:9 aspect ratio */ | |
| } | |
| .iframe-container iframe { | |
| position: absolute; | |
| top: 0; | |
| left: 0; | |
| width: 100%; | |
| height: 100%; | |
| border: none; | |
| } | |
| """ | |
| # Create a Gradio Blocks app | |
| with gr.Blocks(css=css) as demo: | |
| # Add a Markdown component to provide some context | |
| gr.Markdown("## Image Comparison Analysis") | |
| # Add a HTML component to embed the iframe | |
| gr.HTML('<div class="iframe-container"><iframe src="https://noumanjavaid-centii.hf.space"></iframe></div>') | |
| # Launch the app | |
| demo.launch(show_error=True, show_api=False) |