ritwikraha commited on
Commit
773373e
1 Parent(s): f2b23f6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -10
app.py CHANGED
@@ -1,16 +1,8 @@
1
  import gradio as gr
2
- import cv2
3
 
4
  def create_mask(image):
5
- image_array = gr.as_np_array(image)
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(