Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -32,9 +32,9 @@ def lighter(input_path):
|
|
32 |
# Line processing
|
33 |
blurred = cv2.GaussianBlur(img_array, (7, 7), 0)
|
34 |
#lighter
|
35 |
-
edges = cv2.Canny(blurred,
|
36 |
structuring_element = cv2.getStructuringElement(cv2.MORPH_RECT, (2,2))
|
37 |
-
dilated_edges = cv2.dilate(edges, structuring_element, iterations=
|
38 |
line_drawing = 255 - dilated_edges
|
39 |
line_img = Image.fromarray(line_drawing)
|
40 |
return freemium_watermark(line_img, sb_logo)
|
@@ -61,7 +61,7 @@ with gr.Blocks(analytics_enabled=False, theme=gr.themes.Soft()) as demo:
|
|
61 |
with gr.Column():
|
62 |
input = gr.Image(type="pil", label="Upload Image", sources=["upload"])
|
63 |
gr.ClearButton(components=input)
|
64 |
-
gr.Examples(examples=["hotel.jpg", "road_small.jpg", "crash_small.jpg", "trailer.jpg"], inputs=input)
|
65 |
with gr.Column():
|
66 |
output = gr.Image(type = "filepath", label="Sketch Drawing", show_share_button=False)
|
67 |
with gr.Row():
|
|
|
32 |
# Line processing
|
33 |
blurred = cv2.GaussianBlur(img_array, (7, 7), 0)
|
34 |
#lighter
|
35 |
+
edges = cv2.Canny(blurred, 150, 180)
|
36 |
structuring_element = cv2.getStructuringElement(cv2.MORPH_RECT, (2,2))
|
37 |
+
dilated_edges = cv2.dilate(edges, structuring_element, iterations=2)
|
38 |
line_drawing = 255 - dilated_edges
|
39 |
line_img = Image.fromarray(line_drawing)
|
40 |
return freemium_watermark(line_img, sb_logo)
|
|
|
61 |
with gr.Column():
|
62 |
input = gr.Image(type="pil", label="Upload Image", sources=["upload"])
|
63 |
gr.ClearButton(components=input)
|
64 |
+
gr.Examples(examples=["hotel.jpg", "intersection.jpg", "road_small.jpg", "crash_small.jpg", "trailer.jpg"], inputs=input)
|
65 |
with gr.Column():
|
66 |
output = gr.Image(type = "filepath", label="Sketch Drawing", show_share_button=False)
|
67 |
with gr.Row():
|