Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -148,18 +148,23 @@ def extract_gaussian(state: dict, req: gr.Request) -> Tuple[str, str]:
|
|
148 |
torch.cuda.empty_cache()
|
149 |
return gaussian_path, gaussian_path
|
150 |
|
151 |
-
def prepare_multi_example() -> List[
|
|
|
|
|
|
|
|
|
|
|
152 |
multi_case = list(set([i.split('_')[0] for i in os.listdir("assets/example_multi_image")]))
|
153 |
-
|
154 |
for case in multi_case:
|
155 |
-
|
156 |
-
for i in range(1, 4):
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
return
|
163 |
|
164 |
with gr.Blocks(delete_cache=(600, 600)) as demo:
|
165 |
gr.Markdown("""
|
|
|
148 |
torch.cuda.empty_cache()
|
149 |
return gaussian_path, gaussian_path
|
150 |
|
151 |
+
def prepare_multi_example() -> List[Tuple[str, str]]:
|
152 |
+
"""
|
153 |
+
Prepare example images for the 'Multiple Images' gallery.
|
154 |
+
Returns:
|
155 |
+
List[Tuple[str, str]]: A list of tuples containing image paths and captions.
|
156 |
+
"""
|
157 |
multi_case = list(set([i.split('_')[0] for i in os.listdir("assets/example_multi_image")]))
|
158 |
+
examples = []
|
159 |
for case in multi_case:
|
160 |
+
case_images = []
|
161 |
+
for i in range(1, 4): # Assuming 3 views per case
|
162 |
+
img_path = f'assets/example_multi_image/{case}_{i}.png'
|
163 |
+
if os.path.exists(img_path): # Ensure the image exists
|
164 |
+
case_images.append((img_path, f"View {i}"))
|
165 |
+
if case_images: # Only add cases with valid images
|
166 |
+
examples.append(case_images)
|
167 |
+
return examples
|
168 |
|
169 |
with gr.Blocks(delete_cache=(600, 600)) as demo:
|
170 |
gr.Markdown("""
|