LPDoctor commited on
Commit
4086ee3
1 Parent(s): bf1377d

Convert Pil to filepath

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -255,6 +255,10 @@ def inference_single_image(ref_image,
255
  def run_local(base,
256
  ref,
257
  *args):
 
 
 
 
258
  image = base["background"].convert("RGB") #base["image"].convert("RGB")
259
  mask = base["layers"][0] #base["mask"].convert("L")
260
 
@@ -314,12 +318,12 @@ with gr.Blocks() as demo:
314
 
315
  with gr.Row():
316
  base = gr.ImageEditor( label="Source",
317
- type="pil",
318
  brush=gr.Brush(colors=["#FFFFFF"],default_size = 30,color_mode = "fixed"),
319
  layers = False,
320
  interactive=True
321
  )
322
- ref = gr.Image(label="Reference", sources="upload", type="pil", height=512)
323
  run_local_button = gr.Button(value="Run")
324
 
325
 
 
255
  def run_local(base,
256
  ref,
257
  *args):
258
+ print("base文件:",base)
259
+ print("base文件背景图:", base["background"])
260
+ print("base文件层次图:", base["layers"])
261
+ print("参考图:", ref)
262
  image = base["background"].convert("RGB") #base["image"].convert("RGB")
263
  mask = base["layers"][0] #base["mask"].convert("L")
264
 
 
318
 
319
  with gr.Row():
320
  base = gr.ImageEditor( label="Source",
321
+ type="filepath",
322
  brush=gr.Brush(colors=["#FFFFFF"],default_size = 30,color_mode = "fixed"),
323
  layers = False,
324
  interactive=True
325
  )
326
+ ref = gr.Image(label="Reference", sources="upload", type="filepath", height=512)
327
  run_local_button = gr.Button(value="Run")
328
 
329