fountai commited on
Commit
88004fc
1 Parent(s): 9ffbff5
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -32,8 +32,8 @@ DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
32
 
33
  bfl_repo="black-forest-labs/FLUX.1-dev"
34
 
35
- BG_COLOR = (0, 0, 0) # black
36
- MASK_COLOR = (255, 255, 255) # white
37
 
38
  def maskHead(input):
39
  base_options = python.BaseOptions(model_asset_path='selfie_multiclass_256x256.tflite')
@@ -123,7 +123,7 @@ def execute(image, prompt):
123
  for image in range(len(imgs)):
124
  current_img = imgs[image]
125
  cv2.imwrite('base_image.jpg', current_img)
126
- cv2.imwrite("mask.jpg", cv2.bitwise_not(maskHead('base_image.jpg')))
127
 
128
  im = Image.open('base_image.jpg')
129
  mask = Image.open('mask.jpg')
@@ -142,7 +142,6 @@ def execute(image, prompt):
142
  ).images[0]
143
  response.append(result)
144
 
145
-
146
  return response
147
 
148
  iface = gr.Interface(
 
32
 
33
  bfl_repo="black-forest-labs/FLUX.1-dev"
34
 
35
+ BG_COLOR = (255, 255, 255) # white
36
+ MASK_COLOR = (0, 0 , 0) # black
37
 
38
  def maskHead(input):
39
  base_options = python.BaseOptions(model_asset_path='selfie_multiclass_256x256.tflite')
 
123
  for image in range(len(imgs)):
124
  current_img = imgs[image]
125
  cv2.imwrite('base_image.jpg', current_img)
126
+ cv2.imwrite("mask.jpg", maskHead('base_image.jpg'))
127
 
128
  im = Image.open('base_image.jpg')
129
  mask = Image.open('mask.jpg')
 
142
  ).images[0]
143
  response.append(result)
144
 
 
145
  return response
146
 
147
  iface = gr.Interface(