Spaces:
Running
Running
yizhangliu
commited on
Commit
•
41164d3
1
Parent(s):
3f31420
Update app.py
Browse files
app.py
CHANGED
@@ -204,14 +204,17 @@ def model_process(input):
|
|
204 |
torch.cuda.empty_cache()
|
205 |
|
206 |
if alpha_channel is not None:
|
|
|
207 |
if alpha_channel.shape[:2] != res_np_img.shape[:2]:
|
|
|
208 |
alpha_channel = cv2.resize(
|
209 |
alpha_channel, dsize=(res_np_img.shape[1], res_np_img.shape[0])
|
210 |
)
|
|
|
211 |
res_np_img = np.concatenate(
|
212 |
(res_np_img, alpha_channel[:, :, np.newaxis]), axis=-1
|
213 |
)
|
214 |
-
print(f"process time_2_: {(time.time() - start) * 1000}ms, {res_np_img.shape} / {res_np_img[250][250]}")
|
215 |
image = Image.fromarray(res_np_img)
|
216 |
image.save(f'./result_image.png')
|
217 |
return image
|
|
|
204 |
torch.cuda.empty_cache()
|
205 |
|
206 |
if alpha_channel is not None:
|
207 |
+
print(f"liuyz_here_10_: {alpha_channel.shape}")
|
208 |
if alpha_channel.shape[:2] != res_np_img.shape[:2]:
|
209 |
+
print(f"liuyz_here_20_: {alpha_channel.shape} / {res_np_img.shape}")
|
210 |
alpha_channel = cv2.resize(
|
211 |
alpha_channel, dsize=(res_np_img.shape[1], res_np_img.shape[0])
|
212 |
)
|
213 |
+
print(f"liuyz_here_30_: {alpha_channel.shape} / {res_np_img.shape}")
|
214 |
res_np_img = np.concatenate(
|
215 |
(res_np_img, alpha_channel[:, :, np.newaxis]), axis=-1
|
216 |
)
|
217 |
+
print(f"process time_2_: {(time.time() - start) * 1000}ms, {alpha_channel.shape}, {res_np_img.shape} / {res_np_img[250][250]}")
|
218 |
image = Image.fromarray(res_np_img)
|
219 |
image.save(f'./result_image.png')
|
220 |
return image
|