Spaces:
Running
Running
ritwikraha
commited on
Commit
•
773373e
1
Parent(s):
f2b23f6
Update app.py
Browse files
app.py
CHANGED
@@ -1,16 +1,8 @@
|
|
1 |
import gradio as gr
|
2 |
-
import
|
3 |
|
4 |
def create_mask(image):
|
5 |
-
|
6 |
-
|
7 |
-
# Convert image to grayscale for easier segmentation
|
8 |
-
gray = cv2.cvtColor(image_array, cv2.COLOR_BGR2GRAY)
|
9 |
-
|
10 |
-
# Apply thresholding to create a binary mask (adjust threshold value as needed)
|
11 |
-
_, mask = cv2.threshold(gray, 127, 255, cv2.THRESH_BINARY)
|
12 |
-
|
13 |
-
return mask
|
14 |
|
15 |
with gr.Blocks() as demo:
|
16 |
gr.Markdown(
|
|
|
1 |
import gradio as gr
|
2 |
+
import imageio
|
3 |
|
4 |
def create_mask(image):
|
5 |
+
image["mask"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
with gr.Blocks() as demo:
|
8 |
gr.Markdown(
|