Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -43,8 +43,9 @@ title = "Undress AI"
|
|
43 |
description = "β Input photos of people, similar to the test picture at the bottom, and undress pictures will be produced. You may have to wait 30 seconds for a picture. π Do not upload personal photos π There is a queue system. According to the logic of first come, first served, only one picture will be made at a time. Must be able to at least see the outline of a human body β"
|
44 |
|
45 |
examples = [
|
46 |
-
['
|
47 |
-
['
|
|
|
48 |
]
|
49 |
|
50 |
css = """
|
@@ -58,24 +59,21 @@ body {
|
|
58 |
}
|
59 |
footer {display: none !important;}
|
60 |
"""
|
61 |
-
|
62 |
with gr.Blocks(css=css) as demo:
|
63 |
-
|
64 |
-
|
|
|
|
|
|
|
65 |
with gr.Row():
|
66 |
with gr.Column(scale=2): # Adjust scale for proper sizing
|
67 |
-
image_input = gr.Image(type="numpy", label="Upload Image", width=width, height=height
|
68 |
-
|
69 |
-
|
70 |
-
with gr.Column(scale=1): # Adjust scale for proper sizing
|
71 |
-
gr.Markdown("### Examples")
|
72 |
-
example_1 = gr.Examples(examples=[examples[0]], inputs=image_input, examples_per_page=1)
|
73 |
-
example_2 = gr.Examples(examples=[examples[1]], inputs=image_input, examples_per_page=1)
|
74 |
|
75 |
def update_status(img):
|
76 |
-
status.update(value="Processing... Please wait.")
|
77 |
processed_img = inference(img)
|
78 |
-
status.update(value="Processing complete!")
|
79 |
return processed_img
|
80 |
|
81 |
process_button.click(update_status, inputs=image_input, outputs=image_input)
|
|
|
43 |
description = "β Input photos of people, similar to the test picture at the bottom, and undress pictures will be produced. You may have to wait 30 seconds for a picture. π Do not upload personal photos π There is a queue system. According to the logic of first come, first served, only one picture will be made at a time. Must be able to at least see the outline of a human body β"
|
44 |
|
45 |
examples = [
|
46 |
+
['example1.png'],
|
47 |
+
['example2.png'],
|
48 |
+
['example3.png'],
|
49 |
]
|
50 |
|
51 |
css = """
|
|
|
59 |
}
|
60 |
footer {display: none !important;}
|
61 |
"""
|
62 |
+
|
63 |
with gr.Blocks(css=css) as demo:
|
64 |
+
url_params = gr.State()
|
65 |
+
demo.load(get_params, None, url_params)
|
66 |
+
url_params = url_params.value
|
67 |
+
width=320
|
68 |
+
height=240
|
69 |
with gr.Row():
|
70 |
with gr.Column(scale=2): # Adjust scale for proper sizing
|
71 |
+
image_input = gr.Image(type="numpy", label="Upload Image", width=width, height=height)
|
72 |
+
gr.Examples(examples=examples, inputs=image_input, examples_per_page=3)
|
73 |
+
process_button = gr.Button("Nude!").style(width=width)
|
|
|
|
|
|
|
|
|
74 |
|
75 |
def update_status(img):
|
|
|
76 |
processed_img = inference(img)
|
|
|
77 |
return processed_img
|
78 |
|
79 |
process_button.click(update_status, inputs=image_input, outputs=image_input)
|