Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
from PIL import Image
|
|
|
4 |
|
5 |
# Define global paths
|
6 |
BASE_PATH = "ContraCLIP/experiments/wip/"
|
@@ -47,8 +48,9 @@ def display_interactive_plot(latent_code):
|
|
47 |
html_file = os.path.join(LATENT_CODES_DIR, latent_code, f"interactive_latent_space_{latent_code}.html")
|
48 |
if not os.path.exists(html_file):
|
49 |
return f"Interactive file not found: {html_file}"
|
50 |
-
|
51 |
-
|
|
|
52 |
|
53 |
# Gradio Interface
|
54 |
def build_interface():
|
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
from PIL import Image
|
4 |
+
import json
|
5 |
|
6 |
# Define global paths
|
7 |
BASE_PATH = "ContraCLIP/experiments/wip/"
|
|
|
48 |
html_file = os.path.join(LATENT_CODES_DIR, latent_code, f"interactive_latent_space_{latent_code}.html")
|
49 |
if not os.path.exists(html_file):
|
50 |
return f"Interactive file not found: {html_file}"
|
51 |
+
# Embed the HTML file using an iframe
|
52 |
+
iframe = f'<iframe src="{html_file}" width="100%" height="600px" style="border:none;"></iframe>'
|
53 |
+
return iframe
|
54 |
|
55 |
# Gradio Interface
|
56 |
def build_interface():
|