KangLiao commited on
Commit
d938867
·
1 Parent(s): 573386e
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -136,7 +136,7 @@ def camera_understanding(image_src, question, seed, progress=gr.Progress(track_t
136
  suffix = f"_{k}"
137
  out_path = os.path.join(save_dir, f"camera_map_vis{suffix}.png")
138
  plt.tight_layout()
139
- fig.savefig(out_path, dpi=200, bbox_inches='tight', pad_inches=0)
140
  plt.close(fig)
141
  saved_paths.append(out_path)
142
 
@@ -146,6 +146,9 @@ def camera_understanding(image_src, question, seed, progress=gr.Progress(track_t
146
  w, h = img_up.size
147
  left = max(0, w - h)
148
  img_up = img_up.crop((left, 0, w, h))
 
 
 
149
  img_lat = img_lat.crop((left, 0, w, h))
150
 
151
  return text, [img_up], [img_lat]
@@ -213,9 +216,9 @@ with gr.Blocks(css=css) as demo:
213
  with gr.Tab("Camera-controllable Image Generation"):
214
  gr.Markdown(value="## Camera-controllable Image Generation")
215
 
216
- prompt_input = gr.Textbox(label="Prompt.")
217
 
218
- with gr.Accordion("Camera Parameters", open=True):
219
  with gr.Row():
220
  roll = gr.Slider(minimum=-0.7854, maximum=0.7854, value=0.1000, step=0.1000, label="roll value")
221
  pitch = gr.Slider(minimum=-0.7854, maximum=0.7854, value=-0.1000, step=0.1000, label="pitch value")
 
136
  suffix = f"_{k}"
137
  out_path = os.path.join(save_dir, f"camera_map_vis{suffix}.png")
138
  plt.tight_layout()
139
+ fig.savefig(out_path, dpi=100, bbox_inches='tight', pad_inches=0)
140
  plt.close(fig)
141
  saved_paths.append(out_path)
142
 
 
146
  w, h = img_up.size
147
  left = max(0, w - h)
148
  img_up = img_up.crop((left, 0, w, h))
149
+
150
+ w, h = img_lat.size
151
+ left = max(0, w - h)
152
  img_lat = img_lat.crop((left, 0, w, h))
153
 
154
  return text, [img_up], [img_lat]
 
216
  with gr.Tab("Camera-controllable Image Generation"):
217
  gr.Markdown(value="## Camera-controllable Image Generation")
218
 
219
+ prompt_input = gr.Textbox(label="Scene Prompt")
220
 
221
+ with gr.Accordion("Camera Parameters (in radius)", open=True):
222
  with gr.Row():
223
  roll = gr.Slider(minimum=-0.7854, maximum=0.7854, value=0.1000, step=0.1000, label="roll value")
224
  pitch = gr.Slider(minimum=-0.7854, maximum=0.7854, value=-0.1000, step=0.1000, label="pitch value")