ritwikraha commited on
Commit
c721853
·
1 Parent(s): d22ade1
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -241,24 +241,24 @@ 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], depth[0])
245
 
246
  # app.py text matter starts here
247
  st.title('NeRF:Neural Radiance Fields')
248
  # set the values of r theta phi
249
  r = -30.0
250
- theta = st.slider('Enter a value for theta', 0.0, 360.0, 1.0)
251
  st.write('Theta:', theta)
252
- phi = st.slider('Enter a value for phi', 0.0, 360.0, 1.0)
253
  st.write('Phi:', phi)
254
 
255
  color,depth = show_rendered_image(r,theta,phi)
256
 
257
- fig, ax = plt.subplots()
258
- im = ax.imshow(color)
259
- st.pyplot(fig)
260
 
261
- # st.image(color, caption = "Color")
262
  # st.image(depth, caption = "Depth")
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].numpy()*255.0, depth[0].numpy()*255.0)
245
 
246
  # app.py text matter starts here
247
  st.title('NeRF:Neural Radiance Fields')
248
  # set the values of r theta phi
249
  r = -30.0
250
+ theta = st.slider('Enter a value for theta',min_value = 0.0,max_value = 360.0)
251
  st.write('Theta:', theta)
252
+ phi = st.slider('Enter a value for phi',min_value = 0.0,max_value = 360.0)
253
  st.write('Phi:', phi)
254
 
255
  color,depth = show_rendered_image(r,theta,phi)
256
 
257
+ # fig, ax = plt.subplots()
258
+ # im = ax.imshow(color)
259
+ # st.pyplot(fig)
260
 
261
+ st.image(color.astype('int32'), caption = "Color",clamp = True)
262
  # st.image(depth, caption = "Depth")
263
 
264