Spaces:
Sleeping
Sleeping
zimhe
commited on
Commit
·
41c6413
1
Parent(s):
fdd3927
defualt image url
Browse files
app.py
CHANGED
|
@@ -68,17 +68,12 @@ MAX_IMAGE_SIZE = 512
|
|
| 68 |
# 获取当前脚本所在目录
|
| 69 |
current_dir = os.path.dirname(os.path.abspath(__file__))
|
| 70 |
viewer_html_path = os.path.join(current_dir, "viewer.html")
|
| 71 |
-
|
| 72 |
|
| 73 |
# 读取 viewer.html 内容
|
| 74 |
with open(viewer_html_path, 'r', encoding='utf-8') as f:
|
| 75 |
viewer_html_content = f.read()
|
| 76 |
|
| 77 |
-
# 读取默认图片并转换为 base64
|
| 78 |
-
with open(default_image_path, 'rb') as f:
|
| 79 |
-
default_image_data = f.read()
|
| 80 |
-
default_image_base64 = base64.b64encode(default_image_data).decode('utf-8')
|
| 81 |
-
default_image_url = f"data:image/png;base64,{default_image_base64}"
|
| 82 |
|
| 83 |
with open("examples/examples.json", "r") as f:
|
| 84 |
examples_data = json.load(f)
|
|
|
|
| 68 |
# 获取当前脚本所在目录
|
| 69 |
current_dir = os.path.dirname(os.path.abspath(__file__))
|
| 70 |
viewer_html_path = os.path.join(current_dir, "viewer.html")
|
| 71 |
+
default_image_url = "https://huggingface.co/zimhe/SpatialDiffusion/blob/main/examples/004.png"
|
| 72 |
|
| 73 |
# 读取 viewer.html 内容
|
| 74 |
with open(viewer_html_path, 'r', encoding='utf-8') as f:
|
| 75 |
viewer_html_content = f.read()
|
| 76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
|
| 78 |
with open("examples/examples.json", "r") as f:
|
| 79 |
examples_data = json.load(f)
|