Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,9 @@ from rendering import *
|
|
| 10 |
tf.random.set_seed(42)
|
| 11 |
|
| 12 |
def show_rendered_image(r,theta,phi):
|
|
|
|
| 13 |
# Get the camera to world matrix.
|
|
|
|
| 14 |
c2w = pose_spherical(theta, phi, r)
|
| 15 |
|
| 16 |
ray_oris, ray_dirs = get_rays(H, W, focal, c2w)
|
|
@@ -21,10 +23,12 @@ def show_rendered_image(r,theta,phi):
|
|
| 21 |
rgb, depth = render_rgb_depth(
|
| 22 |
nerf_loaded, rays_flat[None, ...], t_vals[None, ...], rand=False, train=False
|
| 23 |
)
|
|
|
|
| 24 |
return(rgb[0], depth[0])
|
| 25 |
|
| 26 |
|
| 27 |
# app.py text matter starts here
|
|
|
|
| 28 |
st.title('NeRF:3D volumetric rendering with NeRF')
|
| 29 |
|
| 30 |
st.markdown("Authors: [Aritra Roy Gosthipathy](https://twitter.com/ariG23498) and [Ritwik Raha](https://twitter.com/ritwik_raha)")
|
|
@@ -54,6 +58,3 @@ with col2:
|
|
| 54 |
depth = tf.keras.utils.array_to_img(depth[..., None])
|
| 55 |
st.image(depth, caption="Depth Map", clamp=True, width=300)
|
| 56 |
|
| 57 |
-
st.markdown("## Credits")
|
| 58 |
-
st.markdown("- [PyImageSearch](https://www.pyimagesearch.com/)")
|
| 59 |
-
st.markdown("- [JarvisLabs.ai GPU credits](https://jarvislabs.ai/)")
|
|
|
|
| 10 |
tf.random.set_seed(42)
|
| 11 |
|
| 12 |
def show_rendered_image(r,theta,phi):
|
| 13 |
+
|
| 14 |
# Get the camera to world matrix.
|
| 15 |
+
|
| 16 |
c2w = pose_spherical(theta, phi, r)
|
| 17 |
|
| 18 |
ray_oris, ray_dirs = get_rays(H, W, focal, c2w)
|
|
|
|
| 23 |
rgb, depth = render_rgb_depth(
|
| 24 |
nerf_loaded, rays_flat[None, ...], t_vals[None, ...], rand=False, train=False
|
| 25 |
)
|
| 26 |
+
|
| 27 |
return(rgb[0], depth[0])
|
| 28 |
|
| 29 |
|
| 30 |
# app.py text matter starts here
|
| 31 |
+
|
| 32 |
st.title('NeRF:3D volumetric rendering with NeRF')
|
| 33 |
|
| 34 |
st.markdown("Authors: [Aritra Roy Gosthipathy](https://twitter.com/ariG23498) and [Ritwik Raha](https://twitter.com/ritwik_raha)")
|
|
|
|
| 58 |
depth = tf.keras.utils.array_to_img(depth[..., None])
|
| 59 |
st.image(depth, caption="Depth Map", clamp=True, width=300)
|
| 60 |
|
|
|
|
|
|
|
|
|