Spaces:
Build error
Build error
Fix Drums option
Browse files
app.py
CHANGED
@@ -16,9 +16,10 @@ with open("config.json") as f:
|
|
16 |
|
17 |
MODEL_DIR = "models"
|
18 |
|
|
|
19 |
|
20 |
-
|
21 |
-
|
22 |
DIET_NERF_MODEL_NAME = cfg[obj_select]["DIET_NERF_MODEL_NAME"]
|
23 |
DIET_NERF_FILE_ID = cfg[obj_select]["DIET_NERF_FILE_ID"]
|
24 |
|
@@ -37,7 +38,8 @@ caption = (
|
|
37 |
)
|
38 |
st.markdown(caption)
|
39 |
st.markdown("")
|
40 |
-
|
|
|
41 |
|
42 |
|
43 |
@st.cache(show_spinner=False)
|
@@ -116,7 +118,9 @@ radius = st.sidebar.slider(
|
|
116 |
st.markdown("")
|
117 |
|
118 |
with st.spinner("Rendering View..."):
|
119 |
-
with st.spinner(
|
|
|
|
|
120 |
dn_pred_color, _ = render_predict_from_pose(diet_nerf_state, theta, phi, radius)
|
121 |
dn_im = predict_to_image(dn_pred_color)
|
122 |
dn_w, _ = dn_im.size
|
@@ -130,14 +134,10 @@ with st.spinner("Rendering View..."):
|
|
130 |
n_im = n_im.resize(size=(n_new_w, n_new_w))
|
131 |
|
132 |
diet_nerf_col, nerf_col = st.beta_columns([1, 1])
|
133 |
-
diet_nerf_col.markdown(
|
134 |
-
"""<h4 style='text-align: center'>DietNeRF</h4>""", unsafe_allow_html=True
|
135 |
-
)
|
136 |
diet_nerf_col.image(dn_im, use_column_width=True)
|
137 |
|
138 |
-
nerf_col.markdown(
|
139 |
-
"""<h4 style='text-align: center'>NeRF</h4>""", unsafe_allow_html=True
|
140 |
-
)
|
141 |
nerf_col.image(n_im, use_column_width=True)
|
142 |
|
143 |
st.markdown(
|
|
|
16 |
|
17 |
MODEL_DIR = "models"
|
18 |
|
19 |
+
SCENES_LIST = ["Mic", "Chair", "Lego", "Drums", "Ship", "Hotdog"]
|
20 |
|
21 |
+
|
22 |
+
def select_model(obj_select):
|
23 |
DIET_NERF_MODEL_NAME = cfg[obj_select]["DIET_NERF_MODEL_NAME"]
|
24 |
DIET_NERF_FILE_ID = cfg[obj_select]["DIET_NERF_FILE_ID"]
|
25 |
|
|
|
38 |
)
|
39 |
st.markdown(caption)
|
40 |
st.markdown("")
|
41 |
+
obj_select = st.selectbox("Select a Scene", SCENES_LIST, index=0)
|
42 |
+
DIET_NERF_MODEL_NAME, DIET_NERF_FILE_ID, NERF_MODEL_NAME, NERF_FILE_ID = select_model(obj_select)
|
43 |
|
44 |
|
45 |
@st.cache(show_spinner=False)
|
|
|
118 |
st.markdown("")
|
119 |
|
120 |
with st.spinner("Rendering View..."):
|
121 |
+
with st.spinner(
|
122 |
+
"It may take around 1-2 mins. In the meantime, why don't you take a look at our report if you haven't already :)"
|
123 |
+
):
|
124 |
dn_pred_color, _ = render_predict_from_pose(diet_nerf_state, theta, phi, radius)
|
125 |
dn_im = predict_to_image(dn_pred_color)
|
126 |
dn_w, _ = dn_im.size
|
|
|
134 |
n_im = n_im.resize(size=(n_new_w, n_new_w))
|
135 |
|
136 |
diet_nerf_col, nerf_col = st.beta_columns([1, 1])
|
137 |
+
diet_nerf_col.markdown("""<h4 style='text-align: center'>DietNeRF</h4>""", unsafe_allow_html=True)
|
|
|
|
|
138 |
diet_nerf_col.image(dn_im, use_column_width=True)
|
139 |
|
140 |
+
nerf_col.markdown("""<h4 style='text-align: center'>NeRF</h4>""", unsafe_allow_html=True)
|
|
|
|
|
141 |
nerf_col.image(n_im, use_column_width=True)
|
142 |
|
143 |
st.markdown(
|