Update app.py
Browse files
app.py
CHANGED
|
@@ -49,6 +49,8 @@ from preprocess.openpose.run_openpose import OpenPose
|
|
| 49 |
from detectron2.data.detection_utils import convert_PIL_to_numpy,_apply_exif_orientation
|
| 50 |
from torchvision.transforms.functional import to_pil_image
|
| 51 |
|
|
|
|
|
|
|
| 52 |
|
| 53 |
def pil_to_binary_mask(pil_image, threshold=0):
|
| 54 |
np_image = np.array(pil_image)
|
|
@@ -404,8 +406,7 @@ for ex_human in human_list_path:
|
|
| 404 |
|
| 405 |
image_blocks = gr.Blocks().queue()
|
| 406 |
with image_blocks as demo:
|
| 407 |
-
gr.Markdown("##
|
| 408 |
-
gr.Markdown("Virtual Try-on with your image and garment image. Check out the [source codes](https://github.com/yisol/IDM-VTON) and the [model](https://huggingface.co/yisol/IDM-VTON)")
|
| 409 |
with gr.Row():
|
| 410 |
with gr.Column():
|
| 411 |
imgs = gr.ImageEditor(sources='upload', type="pil", label='Human. Mask with pen or use auto-masking', interactive=True)
|
|
@@ -463,4 +464,5 @@ with image_blocks as demo:
|
|
| 463 |
|
| 464 |
|
| 465 |
|
| 466 |
-
image_blocks.launch(show_error=True)
|
|
|
|
|
|
| 49 |
from detectron2.data.detection_utils import convert_PIL_to_numpy,_apply_exif_orientation
|
| 50 |
from torchvision.transforms.functional import to_pil_image
|
| 51 |
|
| 52 |
+
HF_TEST_USER_NAME = os.environ["HF_TEST_USER_NAME"]
|
| 53 |
+
HF_PASS = os.environ["HF_PASS"]
|
| 54 |
|
| 55 |
def pil_to_binary_mask(pil_image, threshold=0):
|
| 56 |
np_image = np.array(pil_image)
|
|
|
|
| 406 |
|
| 407 |
image_blocks = gr.Blocks().queue()
|
| 408 |
with image_blocks as demo:
|
| 409 |
+
gr.Markdown("## Virtual Tryo-on")
|
|
|
|
| 410 |
with gr.Row():
|
| 411 |
with gr.Column():
|
| 412 |
imgs = gr.ImageEditor(sources='upload', type="pil", label='Human. Mask with pen or use auto-masking', interactive=True)
|
|
|
|
| 464 |
|
| 465 |
|
| 466 |
|
| 467 |
+
image_blocks.launch(auth=(HF_TEST_USER_NAME, HF_PASS), ssr_mode=False, show_error=True)
|
| 468 |
+
# image_blocks.launch(show_error=True)
|