Spaces:
Sleeping
Sleeping
Add files using upload-large-folder tool
Browse files
cache_uncolored/3ce909b194b5b788402409bac8233a96.glb
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a0a4565d42853228f945f37eb3aaf859a7580bd8b41786adb37c7fe343e42e01
|
| 3 |
+
size 1519936
|
ours_voxels/029_cubify64.obj
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
ours_voxels/cat_statue_cubify64.obj
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
user_study.py
CHANGED
|
@@ -4,6 +4,9 @@ import numpy as np
|
|
| 4 |
|
| 5 |
TRIALS_JSON = "trials.json"
|
| 6 |
LOG_PATH = "responses.csv"
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
def load_trials(path=TRIALS_JSON):
|
| 9 |
with open(path, "r") as f:
|
|
@@ -241,6 +244,17 @@ def submit(choice, voxel_choice, state):
|
|
| 241 |
gr.update(value=None)
|
| 242 |
)
|
| 243 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 244 |
with gr.Blocks(css="""
|
| 245 |
#prompt-img {max-width: 320px; margin: 0 auto;}
|
| 246 |
#prompt-img img {width: 100% !important; height: auto !important;}
|
|
@@ -297,4 +311,18 @@ with gr.Blocks(css="""
|
|
| 297 |
code_box, choice, voxel_choice]
|
| 298 |
)
|
| 299 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 300 |
demo.launch()
|
|
|
|
| 4 |
|
| 5 |
TRIALS_JSON = "trials.json"
|
| 6 |
LOG_PATH = "responses.csv"
|
| 7 |
+
# Check for persistent storage (Hugging Face Spaces)
|
| 8 |
+
if os.path.exists("/data"):
|
| 9 |
+
LOG_PATH = "/data/responses.csv"
|
| 10 |
|
| 11 |
def load_trials(path=TRIALS_JSON):
|
| 12 |
with open(path, "r") as f:
|
|
|
|
| 244 |
gr.update(value=None)
|
| 245 |
)
|
| 246 |
|
| 247 |
+
def get_responses_file(password):
|
| 248 |
+
# Set your password in HF Space Settings as ADMIN_PASSWORD, or use default "123456"
|
| 249 |
+
correct_pass = os.environ.get("ADMIN_PASSWORD", "123456")
|
| 250 |
+
if password != correct_pass:
|
| 251 |
+
raise gr.Error("Incorrect Password")
|
| 252 |
+
|
| 253 |
+
if not os.path.exists(LOG_PATH):
|
| 254 |
+
raise gr.Error("No responses collected yet.")
|
| 255 |
+
|
| 256 |
+
return LOG_PATH
|
| 257 |
+
|
| 258 |
with gr.Blocks(css="""
|
| 259 |
#prompt-img {max-width: 320px; margin: 0 auto;}
|
| 260 |
#prompt-img img {width: 100% !important; height: auto !important;}
|
|
|
|
| 311 |
code_box, choice, voxel_choice]
|
| 312 |
)
|
| 313 |
|
| 314 |
+
gr.Markdown("---")
|
| 315 |
+
with gr.Accordion("Admin Zone (Download Responses)", open=False):
|
| 316 |
+
with gr.Row():
|
| 317 |
+
admin_pass = gr.Textbox(label="Admin Password", type="password", placeholder="Enter password to download")
|
| 318 |
+
download_btn = gr.Button("Download CSV")
|
| 319 |
+
|
| 320 |
+
admin_file = gr.File(label="Responses File", interactive=False)
|
| 321 |
+
|
| 322 |
+
download_btn.click(
|
| 323 |
+
get_responses_file,
|
| 324 |
+
inputs=[admin_pass],
|
| 325 |
+
outputs=[admin_file]
|
| 326 |
+
)
|
| 327 |
+
|
| 328 |
demo.launch()
|