alexlau commited on
Commit
1a30119
1 Parent(s): 57a50dc

set DOWNSAMPLE=4 and then resize a bigger image

Browse files
Files changed (3) hide show
  1. app.py +3 -1
  2. demo/src/config.py +1 -1
  3. demo/src/utils.py +1 -1
app.py CHANGED
@@ -71,5 +71,7 @@ st.markdown(f""" <h4> {caption} </h4> """,
71
  with st.spinner("Rendering Image (may take 2-3 mins)..."):
72
  pred_color, _ = render_predict_from_pose(state, theta, phi, radius)
73
  im = predict_to_image(pred_color)
74
-
 
 
75
  st.image(im, use_column_width=True)
 
71
  with st.spinner("Rendering Image (may take 2-3 mins)..."):
72
  pred_color, _ = render_predict_from_pose(state, theta, phi, radius)
73
  im = predict_to_image(pred_color)
74
+ w, _ = im.size
75
+ new_w = int(2*w)
76
+ im = im.resize(size=(new_w, new_w))
77
  st.image(im, use_column_width=True)
demo/src/config.py CHANGED
@@ -41,4 +41,4 @@ class NerfConfig:
41
  FOCAL = 555.5555155968841
42
  # reduce CHUNK if OOM
43
  CHUNK = 4096
44
- DOWNSAMPLE = 2
 
41
  FOCAL = 555.5555155968841
42
  # reduce CHUNK if OOM
43
  CHUNK = 4096
44
+ DOWNSAMPLE = 4
demo/src/utils.py CHANGED
@@ -23,7 +23,7 @@ def render_predict_from_pose(state, theta, phi, radius):
23
  return pred_color, pred_disp
24
 
25
 
26
- def predict_to_image(pred_out):
27
  image_arr = np.array(np.clip(pred_out, 0., 1.) * 255.).astype(np.uint8)
28
  return Image.fromarray(image_arr)
29
 
 
23
  return pred_color, pred_disp
24
 
25
 
26
+ def predict_to_image(pred_out) -> Image:
27
  image_arr = np.array(np.clip(pred_out, 0., 1.) * 255.).astype(np.uint8)
28
  return Image.fromarray(image_arr)
29