Spaces:
Running
Running
yizhangliu
commited on
Commit
•
21da9c1
1
Parent(s):
b3c6cb3
Update app.py
Browse files
app.py
CHANGED
@@ -139,7 +139,7 @@ def model_process(input):
|
|
139 |
#image, alpha_channel = load_img(image)
|
140 |
# Origin image shape: (512, 512, 3)
|
141 |
|
142 |
-
alpha_channel = np.ones((image.shape[0],image.shape[1]))*255
|
143 |
original_shape = image.shape
|
144 |
interpolation = cv2.INTER_CUBIC
|
145 |
|
@@ -218,7 +218,7 @@ def model_process(input):
|
|
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.fromarray(res_np_img.astype(np.uint8))
|
220 |
image.save(f'./result_image.png')
|
221 |
-
return image
|
222 |
|
223 |
'''
|
224 |
ext = get_image_ext(origin_image_bytes)
|
|
|
139 |
#image, alpha_channel = load_img(image)
|
140 |
# Origin image shape: (512, 512, 3)
|
141 |
|
142 |
+
alpha_channel = (np.ones((image.shape[0],image.shape[1]))*255).astype(np.uint8)
|
143 |
original_shape = image.shape
|
144 |
interpolation = cv2.INTER_CUBIC
|
145 |
|
|
|
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.fromarray(res_np_img.astype(np.uint8))
|
220 |
image.save(f'./result_image.png')
|
221 |
+
return res_np_img.astype(np.uint8) # image
|
222 |
|
223 |
'''
|
224 |
ext = get_image_ext(origin_image_bytes)
|