Spaces:
Build error
Build error
UI Changes
Browse files
app.py
CHANGED
@@ -9,10 +9,10 @@ from demo.src.models import load_trained_model
|
|
9 |
from demo.src.utils import render_predict_from_pose, predict_to_image
|
10 |
#from demo.src.config import MODEL_DIR, MODEL_NAME, FILE_ID
|
11 |
|
12 |
-
st.set_page_config(page_title="DietNeRF
|
13 |
|
14 |
def select_model():
|
15 |
-
obj_select = st.selectbox("Select
|
16 |
if obj_select == 'Chair':
|
17 |
FILE_ID = "17dj0pQieo94TozFv-noSBkXebduij1aM"
|
18 |
MODEL_DIR = 'models'
|
@@ -25,7 +25,7 @@ def select_model():
|
|
25 |
FILE_ID = "14ZeJ86ETQr8dtu6CFoxU-ifvniHKo_Dt"
|
26 |
MODEL_DIR = 'models'
|
27 |
MODEL_NAME = 'diet_nerf_ship'
|
28 |
-
elif obj_select == '
|
29 |
FILE_ID = "11vNlR4lMvV_AVFgVjZmKMrMWGVG7qhNu"
|
30 |
MODEL_DIR = 'models'
|
31 |
MODEL_NAME = 'diet_nerf_hotdog'
|
@@ -42,7 +42,7 @@ def download_model():
|
|
42 |
# unzip=True)
|
43 |
url = f'https://drive.google.com/uc?id={FILE_ID}'
|
44 |
gdown.download(url, _model_path, quiet=False)
|
45 |
-
print(f'
|
46 |
|
47 |
|
48 |
@st.cache(show_spinner=False, allow_output_mutation=True)
|
@@ -72,7 +72,9 @@ caption = "Diet-NeRF achieves SoTA few-shot learning capacity in 3D model recons
|
|
72 |
"outperforming original NeRF!"
|
73 |
st.markdown(f""" <h4> {caption} </h4> """,
|
74 |
unsafe_allow_html=True)
|
75 |
-
|
|
|
|
|
76 |
pred_color, _ = render_predict_from_pose(state, theta, phi, radius)
|
77 |
im = predict_to_image(pred_color)
|
78 |
w, _ = im.size
|
|
|
9 |
from demo.src.utils import render_predict_from_pose, predict_to_image
|
10 |
#from demo.src.config import MODEL_DIR, MODEL_NAME, FILE_ID
|
11 |
|
12 |
+
st.set_page_config(page_title="DietNeRF")
|
13 |
|
14 |
def select_model():
|
15 |
+
obj_select = st.selectbox("Select an object to render", ('Chair', 'Lego','Ship','Hotdog'))
|
16 |
if obj_select == 'Chair':
|
17 |
FILE_ID = "17dj0pQieo94TozFv-noSBkXebduij1aM"
|
18 |
MODEL_DIR = 'models'
|
|
|
25 |
FILE_ID = "14ZeJ86ETQr8dtu6CFoxU-ifvniHKo_Dt"
|
26 |
MODEL_DIR = 'models'
|
27 |
MODEL_NAME = 'diet_nerf_ship'
|
28 |
+
elif obj_select == 'Hotdog':
|
29 |
FILE_ID = "11vNlR4lMvV_AVFgVjZmKMrMWGVG7qhNu"
|
30 |
MODEL_DIR = 'models'
|
31 |
MODEL_NAME = 'diet_nerf_hotdog'
|
|
|
42 |
# unzip=True)
|
43 |
url = f'https://drive.google.com/uc?id={FILE_ID}'
|
44 |
gdown.download(url, _model_path, quiet=False)
|
45 |
+
print(f'Model downloaded from google drive: {_model_path}')
|
46 |
|
47 |
|
48 |
@st.cache(show_spinner=False, allow_output_mutation=True)
|
|
|
72 |
"outperforming original NeRF!"
|
73 |
st.markdown(f""" <h4> {caption} </h4> """,
|
74 |
unsafe_allow_html=True)
|
75 |
+
st.markdown("")
|
76 |
+
|
77 |
+
with st.spinner("Rendering Image, it may take 2-3 mins. So, why don't you read our report in the meantime"):
|
78 |
pred_color, _ = render_predict_from_pose(state, theta, phi, radius)
|
79 |
im = predict_to_image(pred_color)
|
80 |
w, _ = im.size
|