"test/git@developer.sourcefind.cn:change/sglang.git" did not exist on "d85d6dba3bf25c84bd4240fc606ef7494c0089a5"
Commit 585fb047 authored by MoonRide303's avatar MoonRide303
Browse files

Adding default alpha when splitting RGB images

parent ece69bf2
......@@ -153,7 +153,7 @@ class SplitImageWithAlpha:
def split_image_with_alpha(self, image: torch.Tensor):
out_images = [i[:,:,:3] for i in image]
out_alphas = [i[:,:,3] for i in image]
out_alphas = [i[:,:,3] if i.shape[2] > 3 else torch.ones_like(i[:,:,0]) for i in image]
result = (torch.stack(out_images), torch.stack(out_alphas))
return result
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment