Spaces:
Runtime error
Runtime error
fix color
Browse files
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 = (
|
36 |
-
MASK_COLOR = (
|
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",
|
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(
|