Doubiiu commited on
Commit
ec0c93a
1 Parent(s): 30b2c1f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -28
app.py CHANGED
@@ -109,25 +109,24 @@ def viewcrafter_demo(opts):
109
  # # step 1: input an image
110
  # gr.Markdown("---\n## Step 1: Input an Image, selet an elevation angle and a center_scale factor", show_label=False, visible=True)
111
  # gr.Markdown("<div align='left' style='font-size:18px;color: #000000'>1. Estimate an elevation angle that represents the angle at which the image was taken; a value bigger than 0 indicates a top-down view, and it doesn't need to be precise. <br>2. The origin of the world coordinate system is by default defined at the point cloud corresponding to the center pixel of the input image. You can adjust the position of the origin by modifying center_scale; a value smaller than 1 brings the origin closer to you.</div>")
112
- with gr.Row():
113
- with gr.Column():
114
- with gr.Row():
115
- i2v_input_image = gr.Image(label="Input Image",elem_id="input_img")
116
- with gr.Row():
117
- i2v_elevation = gr.Slider(minimum=-45, maximum=45, step=1, elem_id="elevation", label="elevation", value=5)
118
- i2v_center_scale = gr.Slider(minimum=0.1, maximum=2, step=0.1, elem_id="i2v_center_scale", label="center_scale", value=1)
119
- with gr.Column():
120
- with gr.Row():
121
- left = gr.Button(value = "Left")
122
- right = gr.Button(value = "Right")
123
- up = gr.Button(value = "Up")
124
- with gr.Row():
125
- down = gr.Button(value = "Down")
126
- zin = gr.Button(value = "Zoom in")
127
- zout = gr.Button(value = "Zoom out")
128
- with gr.Row():
129
- custom = gr.Button(value = "Customize")
130
- reset = gr.Button(value = "Reset")
131
 
132
  with gr.Column():
133
  with gr.Row():
@@ -144,16 +143,12 @@ def viewcrafter_demo(opts):
144
  with gr.Column():
145
  # gr.Markdown("---\n## Step 3: Generate video", show_label=False, visible=True)
146
  # gr.Markdown("<div align='left' style='font-size:18px;color: #000000'> You can reduce the sampling steps for faster inference; try different random seed if the result is not satisfying. </div>")
 
147
  with gr.Row():
148
- with gr.Column():
149
- i2v_output_video = gr.Video(label="Generated Video",elem_id="output_vid",autoplay=True,show_share_button=True)
150
- with gr.Column():
151
- with gr.Row():
152
- i2v_steps = gr.Slider(minimum=1, maximum=50, step=1, elem_id="i2v_steps", label="Sampling steps", value=50)
153
- i2v_seed = gr.Slider(label='Random seed', minimum=0, maximum=max_seed, step=1, value=0)
154
- i2v_end_btn = gr.Button("Generate video")
155
- with gr.Column():
156
- i2v_traj_video = gr.Video(label="Camera Trajectory",elem_id="traj_vid",autoplay=True,show_share_button=True)
157
 
158
 
159
  gr.Examples(examples=img_examples,
 
109
  # # step 1: input an image
110
  # gr.Markdown("---\n## Step 1: Input an Image, selet an elevation angle and a center_scale factor", show_label=False, visible=True)
111
  # gr.Markdown("<div align='left' style='font-size:18px;color: #000000'>1. Estimate an elevation angle that represents the angle at which the image was taken; a value bigger than 0 indicates a top-down view, and it doesn't need to be precise. <br>2. The origin of the world coordinate system is by default defined at the point cloud corresponding to the center pixel of the input image. You can adjust the position of the origin by modifying center_scale; a value smaller than 1 brings the origin closer to you.</div>")
112
+
113
+ with gr.Column():
114
+ i2v_input_image = gr.Image(label="Input Image",elem_id="input_img")
115
+ with gr.Row():
116
+ i2v_elevation = gr.Slider(minimum=-45, maximum=45, step=1, elem_id="elevation", label="elevation", value=5)
117
+ i2v_center_scale = gr.Slider(minimum=0.1, maximum=2, step=0.1, elem_id="i2v_center_scale", label="center_scale", value=1)
118
+ with gr.Column():
119
+ with gr.Row():
120
+ left = gr.Button(value = "Left")
121
+ right = gr.Button(value = "Right")
122
+ up = gr.Button(value = "Up")
123
+ with gr.Row():
124
+ down = gr.Button(value = "Down")
125
+ zin = gr.Button(value = "Zoom in")
126
+ zout = gr.Button(value = "Zoom out")
127
+ with gr.Row():
128
+ custom = gr.Button(value = "Customize")
129
+ reset = gr.Button(value = "Reset")
 
130
 
131
  with gr.Column():
132
  with gr.Row():
 
143
  with gr.Column():
144
  # gr.Markdown("---\n## Step 3: Generate video", show_label=False, visible=True)
145
  # gr.Markdown("<div align='left' style='font-size:18px;color: #000000'> You can reduce the sampling steps for faster inference; try different random seed if the result is not satisfying. </div>")
146
+ i2v_output_video = gr.Video(label="Generated Video",elem_id="output_vid",autoplay=True,show_share_button=True)
147
  with gr.Row():
148
+ i2v_steps = gr.Slider(minimum=1, maximum=50, step=1, elem_id="i2v_steps", label="Sampling steps", value=50)
149
+ i2v_seed = gr.Slider(label='Random seed', minimum=0, maximum=max_seed, step=1, value=0)
150
+ i2v_end_btn = gr.Button("Generate video")
151
+ i2v_traj_video = gr.Video(label="Camera Trajectory",elem_id="traj_vid",autoplay=True,show_share_button=True)
 
 
 
 
 
152
 
153
 
154
  gr.Examples(examples=img_examples,