Update app.py
Browse files
app.py
CHANGED
@@ -158,7 +158,7 @@ def execute(image, prompt, debug=False):
|
|
158 |
im = Image.fromarray(rgb_image)
|
159 |
person = Image.open('mask_person.jpg')
|
160 |
|
161 |
-
|
162 |
prompt=f"{prompt} {TRIGGER}",
|
163 |
image=im,
|
164 |
mask_image=person,
|
@@ -171,7 +171,7 @@ def execute(image, prompt, debug=False):
|
|
171 |
joint_attention_kwargs={"scale": 0.9},
|
172 |
).images[0]
|
173 |
|
174 |
-
arr = np.array(
|
175 |
rgb_image = cv2.cvtColor(arr, cv2.COLOR_BGR2RGB)
|
176 |
cv2.imwrite('person.jpg', rgb_image)
|
177 |
cv2.imwrite("mask.jpg", maskHead('person.jpg'))
|
@@ -179,7 +179,7 @@ def execute(image, prompt, debug=False):
|
|
179 |
|
180 |
result = pipe(
|
181 |
prompt=f"{prompt} {TRIGGER}",
|
182 |
-
image=
|
183 |
mask_image=mask,
|
184 |
width=1024,
|
185 |
height=1024,
|
@@ -194,7 +194,9 @@ def execute(image, prompt, debug=False):
|
|
194 |
response.append(im)
|
195 |
response.append(person)
|
196 |
response.append(mask)
|
|
|
197 |
|
|
|
198 |
return response
|
199 |
|
200 |
# Created by Fountai
|
|
|
158 |
im = Image.fromarray(rgb_image)
|
159 |
person = Image.open('mask_person.jpg')
|
160 |
|
161 |
+
result0 = pipe(
|
162 |
prompt=f"{prompt} {TRIGGER}",
|
163 |
image=im,
|
164 |
mask_image=person,
|
|
|
171 |
joint_attention_kwargs={"scale": 0.9},
|
172 |
).images[0]
|
173 |
|
174 |
+
arr = np.array(result0)
|
175 |
rgb_image = cv2.cvtColor(arr, cv2.COLOR_BGR2RGB)
|
176 |
cv2.imwrite('person.jpg', rgb_image)
|
177 |
cv2.imwrite("mask.jpg", maskHead('person.jpg'))
|
|
|
179 |
|
180 |
result = pipe(
|
181 |
prompt=f"{prompt} {TRIGGER}",
|
182 |
+
image=result0,
|
183 |
mask_image=mask,
|
184 |
width=1024,
|
185 |
height=1024,
|
|
|
194 |
response.append(im)
|
195 |
response.append(person)
|
196 |
response.append(mask)
|
197 |
+
response.append(result0)
|
198 |
|
199 |
+
response.append(result)
|
200 |
return response
|
201 |
|
202 |
# Created by Fountai
|