ritwikraha commited on
Commit
056fee9
1 Parent(s): 22bc445
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -241,7 +241,7 @@ def show_rendered_image(r,theta,phi):
241
  rgb, depth = render_rgb_depth(
242
  nerf_loaded, rays_flat[None, ...], t_vals[None, ...], rand=False, train=False
243
  )
244
- return(rgb[0].numpy()*255.0, depth[0].numpy()*255.0)
245
 
246
  # app.py text matter starts here
247
  st.title('NeRF:Neural Radiance Fields')
@@ -252,13 +252,16 @@ phi = st.slider('Enter a value for phi',min_value = 0.0,max_value = 360.0)
252
 
253
 
254
  color,depth = show_rendered_image(r,theta,phi)
 
 
255
 
256
- fig, ax = plt.subplots()
257
- im = ax.imshow(color)
258
- st.pyplot(fig)
 
 
 
259
 
260
- #st.image(color.astype('int32'), caption = "Color",clamp = True)
261
- # st.image(depth, caption = "Depth")
262
 
263
 
264
 
 
241
  rgb, depth = render_rgb_depth(
242
  nerf_loaded, rays_flat[None, ...], t_vals[None, ...], rand=False, train=False
243
  )
244
+ return(rgb[0], depth[0])
245
 
246
  # app.py text matter starts here
247
  st.title('NeRF:Neural Radiance Fields')
 
252
 
253
 
254
  color,depth = show_rendered_image(r,theta,phi)
255
+ color = tf.keras.utils.array_to_img(color)
256
+ depth = tf.keras.utils.array_to_img(depth)
257
 
258
+ # fig, ax = plt.subplots()
259
+ # im = ax.imshow(color)
260
+ # st.pyplot(fig)
261
+
262
+ st.image(color, caption = "Color",clamp = True, width = 200)
263
+ st.image(depth, caption = "Depth",clamp = True, width = 200)
264
 
 
 
265
 
266
 
267