yizhangliu commited on
Commit
e20fa2d
1 Parent(s): 31e7adc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -341,7 +341,8 @@ def read_content(file_path: str) -> str:
341
 
342
  def predict(input):
343
  print(f'liuyz_0_', input)
344
-
 
345
  '''
346
  image = dict["image"] # .convert("RGB") #.resize((512, 512))
347
  # target_size = (init_image.shape[0], init_image.shape[1])
@@ -349,12 +350,12 @@ def predict(input):
349
  print(f'liuyz_2_', image.convert("RGB").shape)
350
  print(f'liuyz_3_', image.convert("RGB").resize((512, 512)).shape)
351
  # mask = dict["mask"] # .convert("RGB") #.resize((512, 512))
352
- '''
353
-
354
- output = model_process(input) # dict["image"], dict["mask"])
355
  # output = mask #output.images[0]
356
  # output = pipe(prompt = prompt, image=init_image, mask_image=mask,guidance_scale=7.5)
357
-
358
  return output #, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
359
 
360
  print(f'liuyz_500_here_')
@@ -447,7 +448,7 @@ with image_blocks as demo:
447
  with gr.Box():
448
  with gr.Row():
449
  with gr.Column():
450
- image = gr.Image(source='upload', tool='sketch', type='filepath',label="Upload").style(height=512)
451
  with gr.Row(elem_id="prompt-container").style(mobile_collapse=False, equal_height=True):
452
  # prompt = gr.Textbox(placeholder = 'Your prompt (what you want in place of what is erased)', show_label=False, elem_id="input-text")
453
  btn = gr.Button("Done!").style(
 
341
 
342
  def predict(input):
343
  print(f'liuyz_0_', input)
344
+ image_np = np.array(input["image"])
345
+ print(f'image_np = {image_np.shape}')
346
  '''
347
  image = dict["image"] # .convert("RGB") #.resize((512, 512))
348
  # target_size = (init_image.shape[0], init_image.shape[1])
 
350
  print(f'liuyz_2_', image.convert("RGB").shape)
351
  print(f'liuyz_3_', image.convert("RGB").resize((512, 512)).shape)
352
  # mask = dict["mask"] # .convert("RGB") #.resize((512, 512))
353
+ '''
354
+ # output = model_process(input) # dict["image"], dict["mask"])
355
+
356
  # output = mask #output.images[0]
357
  # output = pipe(prompt = prompt, image=init_image, mask_image=mask,guidance_scale=7.5)
358
+ output = None
359
  return output #, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
360
 
361
  print(f'liuyz_500_here_')
 
448
  with gr.Box():
449
  with gr.Row():
450
  with gr.Column():
451
+ image = gr.Image(source='upload', tool='sketch', type='pil',label="Upload").style(height=512)
452
  with gr.Row(elem_id="prompt-container").style(mobile_collapse=False, equal_height=True):
453
  # prompt = gr.Textbox(placeholder = 'Your prompt (what you want in place of what is erased)', show_label=False, elem_id="input-text")
454
  btn = gr.Button("Done!").style(