WeShop commited on
Commit
c539327
·
1 Parent(s): 661d6f5

image format

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -191,7 +191,7 @@ def upload_image(image, did, ip, user_id, user_name):
191
  timestamp=timestamp,
192
  )
193
  upload_url = upload_image_url
194
- image_format = image.format if image.format else "PNG"
195
  mime_type = f"image/{image_format.lower()}"
196
  with BytesIO() as m_img:
197
  image.save(m_img, format=image_format)
@@ -380,6 +380,7 @@ with gr.Blocks(css=css) as WeShop:
380
  gr.Markdown("#### Step 1: Upload a person image for Pose Change")
381
  main_image_input = gr.Image(
382
  type="pil",
 
383
  label="Main Image",
384
  elem_classes=["image-container", "hide-buttons"]
385
  )
@@ -419,6 +420,7 @@ with gr.Blocks(css=css) as WeShop:
419
  with gr.Column():
420
  gr.Markdown("#### Step 3: Press 'Generate' to get your Pose Change result")
421
  output = gr.Image(
 
422
  label="Pose Change Result",
423
  elem_classes=["image-container", "hide-buttons"],
424
  interactive=False
@@ -459,9 +461,4 @@ with gr.Blocks(css=css) as WeShop:
459
  elem_id="example-res-images"
460
  )
461
  gr.HTML(load_description("assets/footer.html"))
462
- main_image_input.upload(
463
- fn=preprocess_image,
464
- inputs=[main_image_input],
465
- outputs=main_image_input
466
- )
467
  WeShop.queue(api_open=False).launch(show_api=False)
 
191
  timestamp=timestamp,
192
  )
193
  upload_url = upload_image_url
194
+ image_format = "PNG"
195
  mime_type = f"image/{image_format.lower()}"
196
  with BytesIO() as m_img:
197
  image.save(m_img, format=image_format)
 
380
  gr.Markdown("#### Step 1: Upload a person image for Pose Change")
381
  main_image_input = gr.Image(
382
  type="pil",
383
+ format='png',
384
  label="Main Image",
385
  elem_classes=["image-container", "hide-buttons"]
386
  )
 
420
  with gr.Column():
421
  gr.Markdown("#### Step 3: Press 'Generate' to get your Pose Change result")
422
  output = gr.Image(
423
+ format='png',
424
  label="Pose Change Result",
425
  elem_classes=["image-container", "hide-buttons"],
426
  interactive=False
 
461
  elem_id="example-res-images"
462
  )
463
  gr.HTML(load_description("assets/footer.html"))
 
 
 
 
 
464
  WeShop.queue(api_open=False).launch(show_api=False)