Spaces:
Running
Running
Commit
·
235c943
1
Parent(s):
d69f20a
Update app.py
Browse files
app.py
CHANGED
@@ -216,6 +216,7 @@ def model_process_pil(input):
|
|
216 |
)
|
217 |
print(f"liuyz_here_40_: {alpha_channel.shape} / {res_np_img.shape} / {alpha_channel.dtype} / {res_np_img.dtype}")
|
218 |
print(f"process time_2_: {(time.time() - start) * 1000}ms, {alpha_channel.shape}, {res_np_img.shape} / {res_np_img[250][250]} / {res_np_img.dtype}")
|
|
|
219 |
image = Image.open(io.BytesIO(numpy_to_bytes(res_np_img, ext)))
|
220 |
image.save(f'./result_image.png')
|
221 |
return image # res_np_img.astype(np.uint8) # image
|
@@ -359,7 +360,7 @@ def read_content(file_path):
|
|
359 |
|
360 |
return content
|
361 |
|
362 |
-
image_type = 'filepath' #'pil'
|
363 |
def predict(input):
|
364 |
print(f'liuyz_0_', input)
|
365 |
'''
|
|
|
216 |
)
|
217 |
print(f"liuyz_here_40_: {alpha_channel.shape} / {res_np_img.shape} / {alpha_channel.dtype} / {res_np_img.dtype}")
|
218 |
print(f"process time_2_: {(time.time() - start) * 1000}ms, {alpha_channel.shape}, {res_np_img.shape} / {res_np_img[250][250]} / {res_np_img.dtype}")
|
219 |
+
ext = 'png'
|
220 |
image = Image.open(io.BytesIO(numpy_to_bytes(res_np_img, ext)))
|
221 |
image.save(f'./result_image.png')
|
222 |
return image # res_np_img.astype(np.uint8) # image
|
|
|
360 |
|
361 |
return content
|
362 |
|
363 |
+
image_type = 'pil' #'filepath' #'pil'
|
364 |
def predict(input):
|
365 |
print(f'liuyz_0_', input)
|
366 |
'''
|