pablodawson commited on
Commit
6832a6e
1 Parent(s): 705bafd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -223,11 +223,11 @@ def predict_images_3d(dict, depth, prompt="", negative_prompt="", guidance_scale
223
  output = pipe(prompt = prompt, negative_prompt=negative_prompt, image=init_image, mask_image=mask, depth_image=depth_image, guidance_scale=guidance_scale, num_inference_steps=int(steps), strength=strength)
224
 
225
  # resize to original size
226
- depth_image = depth_image.resize(og_size)
227
- output_depth = output.depth[0].resize(og_size)
228
 
229
  depth_in = denormalize(np.array(depth_image), min, max)
230
- depth_out = denormalize(np.array(output_depth), min, max)
231
 
232
  output_image = output.rgb[0]
233
 
@@ -243,8 +243,8 @@ def create_3d_demo():
243
  with gr.Row():
244
  with gr.Row():
245
  with gr.Column():
246
- image = gr.Image(source='upload', tool='sketch', elem_id="image_upload", type="numpy", label="Upload",height=400)
247
- depth = gr.Image(source='upload', elem_id="depth_upload", type="numpy", label="Upload",height=400)
248
  checkbox = gr.Checkbox(label="Keep occlusion edges", value=False)
249
  prompt = gr.Textbox(placeholder="Your prompt (what you want in place of what is erased)", show_label=False, elem_id="prompt")
250
 
 
223
  output = pipe(prompt = prompt, negative_prompt=negative_prompt, image=init_image, mask_image=mask, depth_image=depth_image, guidance_scale=guidance_scale, num_inference_steps=int(steps), strength=strength)
224
 
225
  # resize to original size
226
+ #depth_image = depth_image.resize(og_size)
227
+ #output_depth = output.depth[0].resize(og_size)
228
 
229
  depth_in = denormalize(np.array(depth_image), min, max)
230
+ depth_out = denormalize(np.array(output.depth[0]), min, max)
231
 
232
  output_image = output.rgb[0]
233
 
 
243
  with gr.Row():
244
  with gr.Row():
245
  with gr.Column():
246
+ image = gr.Image(source='upload', tool='sketch', elem_id="image_upload", type="numpy", label="Upload",height=400, shape=(512,512))
247
+ depth = gr.Image(source='upload', elem_id="depth_upload", type="numpy", label="Upload",height=400, shape=(512,512))
248
  checkbox = gr.Checkbox(label="Keep occlusion edges", value=False)
249
  prompt = gr.Textbox(placeholder="Your prompt (what you want in place of what is erased)", show_label=False, elem_id="prompt")
250