antoyo123 commited on
Commit
bc519da
·
1 Parent(s): 4437000

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -35,12 +35,11 @@ def process_image(image, prompt):
35
  mask_image = Image.open("mask.png").convert("RGB")
36
 
37
  # Convert image to BGR format
38
- image = cv2.cvtColor(np.array(image), cv2.COLOR_RGB2BGR)
39
  imageio.imwrite("./data/data.png", image)
40
  # Convert mask to grayscale format
41
  mask_image = mask_image.resize((image.shape[1], image.shape[0]))
42
  mask_image = cv2.cvtColor(np.array(mask_image), cv2.COLOR_RGB2GRAY)
43
- mask_image = cv2.threshold(mask_image, 127, 255, cv2.THRESH_BINARY)[1]
44
 
45
 
46
 
 
35
  mask_image = Image.open("mask.png").convert("RGB")
36
 
37
  # Convert image to BGR format
 
38
  imageio.imwrite("./data/data.png", image)
39
  # Convert mask to grayscale format
40
  mask_image = mask_image.resize((image.shape[1], image.shape[0]))
41
  mask_image = cv2.cvtColor(np.array(mask_image), cv2.COLOR_RGB2GRAY)
42
+ mask_image = cv2.threshold(mask_image, 100, 255, cv2.THRESH_BINARY)[1]
43
 
44
 
45