Spaces:
Build error
Build error
Make default scene selection random
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import json
|
2 |
import math
|
|
|
3 |
import os
|
4 |
|
5 |
import gdown
|
@@ -17,6 +18,7 @@ with open("config.json") as f:
|
|
17 |
MODEL_DIR = "models"
|
18 |
|
19 |
SCENES_LIST = ["Mic", "Chair", "Lego", "Drums", "Ship", "Hotdog"]
|
|
|
20 |
|
21 |
|
22 |
def select_model(obj_select):
|
@@ -92,7 +94,7 @@ st.markdown(
|
|
92 |
)
|
93 |
|
94 |
|
95 |
-
obj_select = st.selectbox("Select a Scene", SCENES_LIST, index=
|
96 |
DIET_NERF_MODEL_NAME, DIET_NERF_FILE_ID, NERF_MODEL_NAME, NERF_FILE_ID = select_model(obj_select)
|
97 |
|
98 |
|
|
|
1 |
import json
|
2 |
import math
|
3 |
+
import random
|
4 |
import os
|
5 |
|
6 |
import gdown
|
|
|
18 |
MODEL_DIR = "models"
|
19 |
|
20 |
SCENES_LIST = ["Mic", "Chair", "Lego", "Drums", "Ship", "Hotdog"]
|
21 |
+
random_index = random.randint(0, len(SCENES_LIST) - 1)
|
22 |
|
23 |
|
24 |
def select_model(obj_select):
|
|
|
94 |
)
|
95 |
|
96 |
|
97 |
+
obj_select = st.selectbox("Select a Scene", SCENES_LIST, index=random_index)
|
98 |
DIET_NERF_MODEL_NAME, DIET_NERF_FILE_ID, NERF_MODEL_NAME, NERF_FILE_ID = select_model(obj_select)
|
99 |
|
100 |
|