Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -29,10 +29,10 @@ def deep_nude_process(inputpath):
|
|
29 |
def inference(img):
|
30 |
global index
|
31 |
bgra = cv2.cvtColor(img, cv2.COLOR_RGBA2BGRA)
|
32 |
-
inputpath = "input_
|
33 |
cv2.imwrite(inputpath, bgra)
|
34 |
|
35 |
-
outputpath = "out_
|
36 |
index += 1
|
37 |
print(time.strftime("START!!!!!!!!! %Y-%m-%d %H:%M:%S", time.localtime()))
|
38 |
output = mainTest(inputpath, outputpath)
|
@@ -47,16 +47,11 @@ examples = [
|
|
47 |
['input.jpg', 'Test'],
|
48 |
]
|
49 |
|
50 |
-
|
51 |
-
|
|
|
|
|
|
|
|
|
52 |
|
53 |
-
|
54 |
-
inputs=gr.Image(type="numpy", label="Upload Image"),
|
55 |
-
outputs=gr.Image(type="numpy", label="Processed Image"),
|
56 |
-
title=title,
|
57 |
-
description=description,
|
58 |
-
examples=examples,
|
59 |
-
)
|
60 |
-
|
61 |
-
if __name__ == '__main__':
|
62 |
-
web.launch()
|
|
|
29 |
def inference(img):
|
30 |
global index
|
31 |
bgra = cv2.cvtColor(img, cv2.COLOR_RGBA2BGRA)
|
32 |
+
inputpath = f"input_{index}.jpg"
|
33 |
cv2.imwrite(inputpath, bgra)
|
34 |
|
35 |
+
outputpath = f"out_{index}.jpg"
|
36 |
index += 1
|
37 |
print(time.strftime("START!!!!!!!!! %Y-%m-%d %H:%M:%S", time.localtime()))
|
38 |
output = mainTest(inputpath, outputpath)
|
|
|
47 |
['input.jpg', 'Test'],
|
48 |
]
|
49 |
|
50 |
+
with gr.Blocks() as demo:
|
51 |
+
with gr.Column():
|
52 |
+
image_input = gr.Image(type="numpy", label="Upload Image")
|
53 |
+
process_button = gr.Button("Process Image")
|
54 |
+
|
55 |
+
process_button.click(inference, inputs=image_input, outputs=image_input)
|
56 |
|
57 |
+
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|