Spaces:
Running
Running
yizhangliu
commited on
Commit
·
64db352
1
Parent(s):
32a7fde
Update app.py
Browse files
app.py
CHANGED
@@ -212,15 +212,19 @@ def read_content(file_path: str) -> str:
|
|
212 |
return content
|
213 |
|
214 |
def predict(dict):
|
215 |
-
|
|
|
216 |
init_image = dict["image"] # .convert("RGB") #.resize((512, 512))
|
217 |
target_size = (init_image.shape[0], init_image.shape[1])
|
218 |
print(f'liuyz_1_', init_image, target_size)
|
219 |
print(f'liuyz_2_', init_image.convert("RGB").shape)
|
220 |
print(f'liuyz_3_', init_image.convert("RGB").resize((512, 512)).shape)
|
221 |
mask = dict["mask"] # .convert("RGB") #.resize((512, 512))
|
222 |
-
|
223 |
-
|
|
|
|
|
|
|
224 |
# output = pipe(prompt = prompt, image=init_image, mask_image=mask,guidance_scale=7.5)
|
225 |
|
226 |
return output #, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
|
|
|
212 |
return content
|
213 |
|
214 |
def predict(dict):
|
215 |
+
'''
|
216 |
+
print(f'liuyz_0_', dict)
|
217 |
init_image = dict["image"] # .convert("RGB") #.resize((512, 512))
|
218 |
target_size = (init_image.shape[0], init_image.shape[1])
|
219 |
print(f'liuyz_1_', init_image, target_size)
|
220 |
print(f'liuyz_2_', init_image.convert("RGB").shape)
|
221 |
print(f'liuyz_3_', init_image.convert("RGB").resize((512, 512)).shape)
|
222 |
mask = dict["mask"] # .convert("RGB") #.resize((512, 512))
|
223 |
+
'''
|
224 |
+
image = Image.fromarray(dict["image"])
|
225 |
+
mask= Image.fromarray(dict["mask"])
|
226 |
+
output = model_process(image, mask)
|
227 |
+
output = output.images[0]
|
228 |
# output = pipe(prompt = prompt, image=init_image, mask_image=mask,guidance_scale=7.5)
|
229 |
|
230 |
return output #, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
|