Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -54,8 +54,15 @@ def get_canny_filter(image):
|
|
| 54 |
def generate_images(canvas,output_type):
|
| 55 |
base64_img = canvas
|
| 56 |
image_data = base64.b64decode(base64_img.split(',')[1])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
input_img = Image.open(BytesIO(image_data)).convert(
|
| 58 |
-
'RGB').resize((512,
|
|
|
|
| 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)
|
|
|
|
| 54 |
def generate_images(canvas,output_type):
|
| 55 |
base64_img = canvas
|
| 56 |
image_data = base64.b64decode(base64_img.split(',')[1])
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
left =128
|
| 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)
|