Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,6 +6,8 @@ import numpy as np
|
|
| 6 |
import base64
|
| 7 |
import cv2
|
| 8 |
import os
|
|
|
|
|
|
|
| 9 |
canvas_html = '<div style="height:50%"><pose-maker/></div>'
|
| 10 |
low_threshold = 100
|
| 11 |
high_threshold = 200
|
|
@@ -57,10 +59,10 @@ def generate_images(canvas,output_type):
|
|
| 57 |
input_img = input_img.filter(ImageFilter.GaussianBlur(radius=2))
|
| 58 |
input_img = get_canny_filter(input_img) if output_type == "Canny" else input_img
|
| 59 |
input_img = ImageOps.invert(input_img)
|
| 60 |
-
input_img.save("
|
| 61 |
-
out = os.path.abspath("
|
| 62 |
out_url = f'https://omnibus-model-mover.hf.space/file={out}'
|
| 63 |
-
return "
|
| 64 |
def placeholder_fn(axis):
|
| 65 |
pass
|
| 66 |
with gr.Blocks() as b:
|
|
|
|
| 6 |
import base64
|
| 7 |
import cv2
|
| 8 |
import os
|
| 9 |
+
import uuid
|
| 10 |
+
uid=uuid.uuid4()
|
| 11 |
canvas_html = '<div style="height:50%"><pose-maker/></div>'
|
| 12 |
low_threshold = 100
|
| 13 |
high_threshold = 200
|
|
|
|
| 59 |
input_img = input_img.filter(ImageFilter.GaussianBlur(radius=2))
|
| 60 |
input_img = get_canny_filter(input_img) if output_type == "Canny" else input_img
|
| 61 |
input_img = ImageOps.invert(input_img)
|
| 62 |
+
input_img.save(f"{uid}-pose.png")
|
| 63 |
+
out = os.path.abspath(f"{uid}-pose.png")
|
| 64 |
out_url = f'https://omnibus-model-mover.hf.space/file={out}'
|
| 65 |
+
return f"{uid}-pose.png",f"{uid}-pose.png",out_url
|
| 66 |
def placeholder_fn(axis):
|
| 67 |
pass
|
| 68 |
with gr.Blocks() as b:
|