Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -60,11 +60,15 @@ def generate_images(canvas,output_type):
|
|
| 60 |
top = 0
|
| 61 |
right = 384
|
| 62 |
bottom = 512
|
|
|
|
| 63 |
input_img = Image.open(BytesIO(image_data)).convert(
|
| 64 |
'RGB').resize((512,512)).crop((left, top, right, bottom))
|
| 65 |
|
| 66 |
input_img = input_img.filter(ImageFilter.GaussianBlur(radius=2))
|
| 67 |
-
input_img = get_canny_filter(input_img) if output_type == "Canny" else input_img
|
|
|
|
|
|
|
|
|
|
| 68 |
#input_img = ImageOps.invert(input_img)
|
| 69 |
input_img.save(f"{uid}-pose.png")
|
| 70 |
out = os.path.abspath(f"{uid}-pose.png")
|
|
|
|
| 60 |
top = 0
|
| 61 |
right = 384
|
| 62 |
bottom = 512
|
| 63 |
+
|
| 64 |
input_img = Image.open(BytesIO(image_data)).convert(
|
| 65 |
'RGB').resize((512,512)).crop((left, top, right, bottom))
|
| 66 |
|
| 67 |
input_img = input_img.filter(ImageFilter.GaussianBlur(radius=2))
|
| 68 |
+
input_img = ImageOps.invert(get_canny_filter(input_img)) if output_type == "Canny" else input_img
|
| 69 |
+
input_img = ImageOps.invert(input_img) if output_type == "Depth" else input_img
|
| 70 |
+
input_img = canvas.resize((512,512)).crop((left, top, right, bottom)) if output_type == "Base" else input_img
|
| 71 |
+
|
| 72 |
#input_img = ImageOps.invert(input_img)
|
| 73 |
input_img.save(f"{uid}-pose.png")
|
| 74 |
out = os.path.abspath(f"{uid}-pose.png")
|