Spaces:
Build error
Build error
Code formatting
Browse files
app.py
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
-
import os
|
2 |
-
import builtins
|
3 |
-
import math
|
4 |
import json
|
|
|
|
|
5 |
|
6 |
-
import streamlit as st
|
7 |
import gdown
|
|
|
|
|
8 |
|
9 |
from demo.src.models import load_trained_model
|
10 |
-
from demo.src.utils import
|
11 |
|
12 |
st.set_page_config(page_title="DietNeRF")
|
13 |
|
@@ -55,13 +55,28 @@ st.sidebar.markdown(
|
|
55 |
)
|
56 |
st.sidebar.header("SELECT YOUR VIEW DIRECTION")
|
57 |
theta = st.sidebar.slider(
|
58 |
-
"Rotation (Left to Right)",
|
|
|
|
|
|
|
|
|
|
|
59 |
)
|
60 |
phi = st.sidebar.slider(
|
61 |
-
"Rotation (Down to Up)",
|
|
|
|
|
|
|
|
|
|
|
62 |
)
|
63 |
radius = st.sidebar.slider(
|
64 |
-
"Distance (Close to Far)",
|
|
|
|
|
|
|
|
|
|
|
65 |
)
|
66 |
caption = (
|
67 |
"`DietNeRF` achieves state-of-the-art few-shot learning capacity in 3D model reconstruction. "
|
@@ -90,6 +105,7 @@ def download_diet_nerf_model():
|
|
90 |
print(f"Model downloaded from google drive: {diet_nerf_model_path}")
|
91 |
|
92 |
|
|
|
93 |
# def download_nerf_model():
|
94 |
# nerf_model_path = os.path.join(MODEL_DIR, NERF_MODEL_NAME)
|
95 |
# url = f"https://drive.google.com/uc?id={NERF_FILE_ID}"
|
|
|
|
|
|
|
|
|
1 |
import json
|
2 |
+
import math
|
3 |
+
import os
|
4 |
|
|
|
5 |
import gdown
|
6 |
+
import streamlit as st
|
7 |
+
|
8 |
|
9 |
from demo.src.models import load_trained_model
|
10 |
+
from demo.src.utils import predict_to_image, render_predict_from_pose
|
11 |
|
12 |
st.set_page_config(page_title="DietNeRF")
|
13 |
|
|
|
55 |
)
|
56 |
st.sidebar.header("SELECT YOUR VIEW DIRECTION")
|
57 |
theta = st.sidebar.slider(
|
58 |
+
"Rotation (Left to Right)",
|
59 |
+
min_value=-pi,
|
60 |
+
max_value=pi,
|
61 |
+
step=0.5,
|
62 |
+
value=0.0,
|
63 |
+
help="Rotational angle in Horizontal direction (Theta)",
|
64 |
)
|
65 |
phi = st.sidebar.slider(
|
66 |
+
"Rotation (Down to Up)",
|
67 |
+
min_value=0.0,
|
68 |
+
max_value=0.5 * pi,
|
69 |
+
step=0.1,
|
70 |
+
value=1.0,
|
71 |
+
help="Rotational angle in Vertical direction (Phi)",
|
72 |
)
|
73 |
radius = st.sidebar.slider(
|
74 |
+
"Distance (Close to Far)",
|
75 |
+
min_value=2.0,
|
76 |
+
max_value=6.0,
|
77 |
+
step=1.0,
|
78 |
+
value=3.0,
|
79 |
+
help="Distance between object and the viewer (Radius)",
|
80 |
)
|
81 |
caption = (
|
82 |
"`DietNeRF` achieves state-of-the-art few-shot learning capacity in 3D model reconstruction. "
|
|
|
105 |
print(f"Model downloaded from google drive: {diet_nerf_model_path}")
|
106 |
|
107 |
|
108 |
+
# @st.cache(show_spinner=False)
|
109 |
# def download_nerf_model():
|
110 |
# nerf_model_path = os.path.join(MODEL_DIR, NERF_MODEL_NAME)
|
111 |
# url = f"https://drive.google.com/uc?id={NERF_FILE_ID}"
|