Spaces:
Sleeping
Sleeping
umairahmad89 commited on
Commit ·
13d16a8
1
Parent(s): dea7d7c
invert output image
Browse files
app.py
CHANGED
|
@@ -16,7 +16,8 @@ def detect_edges(image:str, sigma, upper_thresh, lower_thresh)->np.ndarray:
|
|
| 16 |
low_threshold=lower_thresh,
|
| 17 |
high_threshold=upper_thresh,
|
| 18 |
)
|
| 19 |
-
|
|
|
|
| 20 |
|
| 21 |
edge_detector_interface = gr.Interface(
|
| 22 |
fn=detect_edges,
|
|
@@ -29,4 +30,4 @@ edge_detector_interface = gr.Interface(
|
|
| 29 |
outputs=[gr.Image(label="Edge Detected Image", image_mode="L", height=400)]
|
| 30 |
)
|
| 31 |
|
| 32 |
-
edge_detector_interface.launch()
|
|
|
|
| 16 |
low_threshold=lower_thresh,
|
| 17 |
high_threshold=upper_thresh,
|
| 18 |
)
|
| 19 |
+
inverted_image = cv2.bitwise_not(edges)
|
| 20 |
+
return inverted_image*255
|
| 21 |
|
| 22 |
edge_detector_interface = gr.Interface(
|
| 23 |
fn=detect_edges,
|
|
|
|
| 30 |
outputs=[gr.Image(label="Edge Detected Image", image_mode="L", height=400)]
|
| 31 |
)
|
| 32 |
|
| 33 |
+
edge_detector_interface.launch()
|