Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ from PIL import Image
|
|
5 |
# Define global paths
|
6 |
BASE_PATH = "disentangled-image-editing-final-project/ContraCLIP/experiments/wip"
|
7 |
LATENT_CODES_DIR = os.path.join(BASE_PATH, "results")
|
8 |
-
SEMANTIC_DIPOLES_FILE = os.path.join(LATENT_CODES_DIR, "semantic_dipoles.json")
|
9 |
DEFAULT_IMAGE = "original_image.jpg"
|
10 |
|
11 |
# Load semantic dipoles
|
@@ -43,7 +43,7 @@ def display_image(latent_code, semantic_dipole, frame_idx):
|
|
43 |
|
44 |
# Function to display GAN latent space interactive plot
|
45 |
def display_interactive_plot(latent_code):
|
46 |
-
html_file = os.path.join(LATENT_CODES_DIR, latent_code, "
|
47 |
if not os.path.exists(html_file):
|
48 |
return f"Interactive file not found: {html_file}"
|
49 |
with open(html_file, "r") as file:
|
|
|
5 |
# Define global paths
|
6 |
BASE_PATH = "disentangled-image-editing-final-project/ContraCLIP/experiments/wip"
|
7 |
LATENT_CODES_DIR = os.path.join(BASE_PATH, "results")
|
8 |
+
SEMANTIC_DIPOLES_FILE = os.path.join(LATENT_CODES_DIR, "stylegan2_ffhq1024-4/32_0.2_6.4/semantic_dipoles.json")
|
9 |
DEFAULT_IMAGE = "original_image.jpg"
|
10 |
|
11 |
# Load semantic dipoles
|
|
|
43 |
|
44 |
# Function to display GAN latent space interactive plot
|
45 |
def display_interactive_plot(latent_code):
|
46 |
+
html_file = os.path.join(LATENT_CODES_DIR, latent_code, f"interactive_latent_space_{latent_code}.html")
|
47 |
if not os.path.exists(html_file):
|
48 |
return f"Interactive file not found: {html_file}"
|
49 |
with open(html_file, "r") as file:
|