Spaces:
Build error
Build error
Added config.json for models
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import os
|
2 |
import builtins
|
3 |
import math
|
|
|
4 |
import streamlit as st
|
5 |
import gdown
|
6 |
|
@@ -13,25 +14,31 @@ from demo.src.utils import render_predict_from_pose, predict_to_image
|
|
13 |
|
14 |
st.set_page_config(page_title="DietNeRF")
|
15 |
|
|
|
|
|
|
|
16 |
|
17 |
def select_model():
|
18 |
obj_select = st.selectbox("Select a scene", ("Chair", "Lego", "Ship", "Hotdog"))
|
19 |
-
if obj_select == "Chair":
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
elif obj_select == "Lego":
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
elif obj_select == "Ship":
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
elif obj_select == "Hotdog":
|
32 |
-
|
33 |
-
|
34 |
-
|
|
|
|
|
|
|
35 |
return MODEL_DIR, MODEL_NAME, FILE_ID
|
36 |
|
37 |
|
@@ -71,7 +78,7 @@ if not os.path.isfile(model_path):
|
|
71 |
|
72 |
model, state = fetch_model()
|
73 |
pi = math.pi
|
74 |
-
|
75 |
st.sidebar.markdown(
|
76 |
"""
|
77 |
<style>
|
|
|
1 |
import os
|
2 |
import builtins
|
3 |
import math
|
4 |
+
import json
|
5 |
import streamlit as st
|
6 |
import gdown
|
7 |
|
|
|
14 |
|
15 |
st.set_page_config(page_title="DietNeRF")
|
16 |
|
17 |
+
with open("config.json") as f:
|
18 |
+
cfg = json.loads(f.read())
|
19 |
+
|
20 |
|
21 |
def select_model():
|
22 |
obj_select = st.selectbox("Select a scene", ("Chair", "Lego", "Ship", "Hotdog"))
|
23 |
+
# if obj_select == "Chair":
|
24 |
+
# FILE_ID = "17dj0pQieo94TozFv-noSBkXebduij1aM"
|
25 |
+
# MODEL_DIR = "models"
|
26 |
+
# MODEL_NAME = "diet_nerf_chair"
|
27 |
+
# elif obj_select == "Lego":
|
28 |
+
# FILE_ID = "1D9I-qIVMPaxuCHfUWPWMHaoLYtAmCjwI"
|
29 |
+
# MODEL_DIR = "models"
|
30 |
+
# MODEL_NAME = "diet_nerf_lego"
|
31 |
+
# elif obj_select == "Ship":
|
32 |
+
# FILE_ID = "14ZeJ86ETQr8dtu6CFoxU-ifvniHKo_Dt"
|
33 |
+
# MODEL_DIR = "models"
|
34 |
+
# MODEL_NAME = "diet_nerf_ship"
|
35 |
+
# elif obj_select == "Hotdog":
|
36 |
+
# FILE_ID = "11vNlR4lMvV_AVFgVjZmKMrMWGVG7qhNu"
|
37 |
+
# MODEL_DIR = "models"
|
38 |
+
# MODEL_NAME = "diet_nerf_hotdog"
|
39 |
+
MODEL_DIR = "models"
|
40 |
+
MODEL_NAME = cfg[obj_select]["DIET_NERF_MODEL_NAME"]
|
41 |
+
FILE_ID = cfg[obj_select]["FILE_ID"]
|
42 |
return MODEL_DIR, MODEL_NAME, FILE_ID
|
43 |
|
44 |
|
|
|
78 |
|
79 |
model, state = fetch_model()
|
80 |
pi = math.pi
|
81 |
+
|
82 |
st.sidebar.markdown(
|
83 |
"""
|
84 |
<style>
|